Top 10 doc of a User get changed when i insert data in another user's space

Problem Statement:

  1. I have 1000 users in my index
  2. when I use this query
 {
     "query": {
       "bool": {
         "must": [
           {
             "match": {
               "keywords": {
                 "query": "hdfc",
                 "operator": "OR",
                 "prefix_length": 0,
                 "max_expansions": 50,
                 "fuzzy_transpositions": true,
                 "lenient": false,
                 "zero_terms_query": "NONE",
                 "auto_generate_synonyms_phrase_query": true,
                 "boost": 1.0
               }
             }
           },
           {
             "match": {
               "keywords": {
                 "query": "2018-19",
                 "operator": "OR",
                 "prefix_length": 0,
                 "max_expansions": 50,
                 "fuzzy_transpositions": true,
                 "lenient": false,
                 "zero_terms_query": "NONE",
                 "auto_generate_synonyms_phrase_query": true,
                 "boost": 1.0
               }
             }
           },
           {
             "match": {
               "userId": {
                 "query": "test2345",
                 "operator": "OR",
                 "prefix_length": 0,
                 "max_expansions": 50,
                 "fuzzy_transpositions": true,
                 "lenient": false,
                 "zero_terms_query": "NONE",
                 "auto_generate_synonyms_phrase_query": true,
                 "boost": 1.0
               }
             }
           }
         ],
         "should": [
           {
             "match": {
               "keywords": {
                 "query": "profits",
                 "operator": "OR",
                 "prefix_length": 0,
                 "max_expansions": 50,
                 "fuzzy_transpositions": true,
                 "lenient": false,
                 "zero_terms_query": "NONE",
                 "auto_generate_synonyms_phrase_query": true,
                 "boost": 1.0
               }
             }
           }
         ],
         "adjust_pure_negative": true,
         "minimum_should_match": "0",
         "boost": 1.0
       }
     }
   }

then I got top 10 results.
3. After the 2nd step, we add data to other users space.
4. if we are hitting the same query again then our top 10 get changed

can you please help me on this?

Welcome!

If you want to have consistent results whatever is indexed in the meantime, you probably need to use the scroll API. But you will have to keep the first data that has been retrieved so far in your application most likely.

Actually , i have not added data in given user so top 10 docs should not changes. score should consistent for this user for a given query.

What is the problem? Could you share the result?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.