-
Notifications
You must be signed in to change notification settings - Fork 1.2k
How to use the MultiTermVectorsAsync API #3219
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
Comments
Apologies for the late response @AymanGaafar. The Multi Term Vectors API within NEST does not expose the ability to set only Ids, it always assumes that you are passing elasticsearch-net/src/Nest/Document/Multiple/MultiTermVectors/MultiTermVectorsRequest.cs Lines 10 to 11 in d4af36f
Even when passing client.MultiTermVectors(mt => mt
.Index("123_original")
.Type("_doc")
.GetMany<object>(ids)
.Fields("*")
.Positions(false)
.Offsets(false)
.Payloads(false)
.TermStatistics(false)
.FieldStatistics(false)
); The POST http://localhost:9200/123_original/_doc/_mtermvectors?pretty=true&fields=*&positions=false&offsets=false&payloads=false&term_statistics=false&field_statistics=false
{
"docs": [
{
"_index": "users",
"_type": "object",
"_id": "9a271078-086f-4f4b-8ca0-16376c2f49a7"
},
{
"_index": "users",
"_type": "object",
"_id": "481ce3db-69bf-4886-9c38-fcb878d44925"
}
]
} I think we can expose this in a more consumable way within the client in the future. The good news is that you can submit the exact query that you would like with the low level client exposed on MultiTermVectorsResponse response =
client.LowLevel.Mtermvectors<MultiTermVectorsResponse>("123_original", "_doc", PostData.Serializable(new
{
ids = ids,
parameters = new
{
fields = new[] { "*" },
positions = false,
offsets = false,
payloads = false,
term_statistics = false,
field_statistics = false
}
})); which will send the following request: POST http://localhost:9200/123_original/_doc/_mtermvectors?pretty=true
{
"ids": [
"9a271078-086f-4f4b-8ca0-16376c2f49a7",
"481ce3db-69bf-4886-9c38-fcb878d44925"
],
"parameters": {
"fields": [
"*"
],
"positions": false,
"offsets": false,
"payloads": false,
"term_statistics": false,
"field_statistics": false
}
} |
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
I've opened #3382 to address |
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
This commit adds support for providing a set of Ids to MultiTermVectors API to be used in conjunction with index and type provided in the URI. Index() and Type() methods added to MultiTermVectorOperation to allow the default typeof(T) values to be overidden. Closes #3219
Thanks @russcam, make sense now |
NEST/Elasticsearch.Net version: 6.0.2
Elasticsearch version: 6.2.3
Description of the problem including expected versus actual behavior:
I am trying to call the below query using NEST
The NEST API (I think) would look something like this
The problem is that the above API is returning the following error
Index name is null for the given type and no default index is set. Map an index name using ConnectionSettings.DefaultMappingFor<TDocument>() or set a default index using ConnectionSettings.DefaultIndex().
And this is the query that its trying to execute which has the index in it and is missing the ids, but works in Kibana when the ids are set.
123_original/_doc/_mtermvectors?fields=%2A&field_statistics=false&positions=false&offsets=false&term_statistics=false&payloads=false
I cannot find a documentation on how to use the Multi Term Vector using NEST.
related Stackoverflow issue: https://stackoverflow.com/questions/50058822/how-to-use-multitermvectorsasync
The text was updated successfully, but these errors were encountered: