As asked in this link
I need to provide relationship based search.
Let's consider the same scenario.
Team and Players would contain similar fields.
A single team can have multiple players.
Having a Single Index for this would be something of this structure :
Any update to a particular part of "Players" array. Let's say " first" : "John" is changed to "first":"Mark"
This updating procedure requires reindexing the entire nested document.
Is there a procedure to Update just the array element to which it belongs to?
I would be using copy_to field and search would be based on accessibility and this is done through "country_ID". If a user has access to "Country_ID" :"679" and not to "123".
If a user searches for a string "Smith", will "Smith" with "country_ID" :"123"
also be searched and highlighted? If so, how do we prevent it from happening?
Suppose one player has to be deleted, let's say Alice Smith , Is there a procedure to just delete this player or does it require reindexing of this document without details of Alice Smith?
My mapping is defined such that there exists a copy_to field enabled. This means Nested Object "Players" and all the other fields part of this JSON are also part of copy_to field.
Users might have access to search on only few players. For example, I have access to search only on "John Smith" and not "Alice Smith". This accessibility is based on "country_ID", which is part of my query through filter. I am using the "copy_to" field to search.
Incase I search on "Smith", I have to make sure it searches only "Smith" with "country_ID" :"123" and not "country_ID" : "679 and only the former should be part of the result.
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
Could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.
A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.
There's no way to reproduce the problem without a full script. Unless someone wants to assemble it from the snippets you provided.
I'd recommend providing it yourself as described per the link I shared.
@Nikesh let me paste the documentation I linked to in case you did not read it yet.
A typical script like this one can be copied and pasted in Kibana Dev Console by any reader. It will definitely help to play with your example and provide a fix for your script.
If you don't provide it, there is a chance that nobody can help.
Emphasis is mine.
Here is a typical script that anyone can use for example:
DELETE index
PUT index/_doc/1
{
"foo": "bar"
}
GET index/_search
{
"query": {
"match": {
"foo": "bar"
}
}
}
Probably because of a typo with Players vs players.
I changed your "script" by removing all the non needed characters **, removing blank lines, ...
I also added a nested query to make your initial query works.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.