-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes for elastic v7 #32
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ func CreateNewIndex(url string, alias string) (string, error) { | |
} | ||
|
||
// initialize our index | ||
createURL := fmt.Sprintf("%s/%s", url, physicalIndex) | ||
createURL := fmt.Sprintf("%s/%s?include_type_name=true", url, physicalIndex) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for mapping to be supported. |
||
_, err := MakeJSONRequest(http.MethodPut, createURL, indexSettings, nil) | ||
if err != nil { | ||
return "", err | ||
|
@@ -631,10 +631,10 @@ const indexSettings = ` | |
const lastModifiedQuery = `{ "sort": [{ "modified_on_mu": "desc" }]}` | ||
|
||
// indexes a contact | ||
const indexCommand = `{ "index": { "_id": %d, "_type": "_doc", "_version": %d, "_version_type": "external", "_routing": %d} }` | ||
const indexCommand = `{ "index": { "_id": %d, "_type": "_doc", "version": %d, "version_type": "external", "routing": %d} }` | ||
|
||
// deletes a contact | ||
const deleteCommand = `{ "delete" : { "_id": %d, "_type": "_doc", "_version": %d, "_version_type": "external", "_routing": %d} }` | ||
const deleteCommand = `{ "delete" : { "_id": %d, "_type": "_doc", "version": %d, "version_type": "external", "routing": %d} }` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same parameters, just no underscores anymore. |
||
|
||
// adds an alias for an index | ||
type addAliasCommand struct { | ||
|
@@ -660,8 +660,10 @@ type aliasCommand struct { | |
// our response for finding the most recent contact | ||
type queryResponse struct { | ||
Hits struct { | ||
Total int `json:"total"` | ||
Hits []struct { | ||
Total struct { | ||
Value int `json:"value"` | ||
} `json:"total"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now an object, this will have repercussions on how we query on the mailroom side. |
||
Hits []struct { | ||
Source struct { | ||
ID int64 `json:"id"` | ||
ModifiedOn time.Time `json:"modified_on"` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a little
go mod tidy
wouldn't go amissThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought the same, but no, these are all still there afterwards.