2

mappings

"brandKeyword" : {
          "type" : "text",
          "norms" : false,
          "analyzer" : "nori_custom"}

value example1

["apple", "samsung", "lg"]

value example2

"apple samsung lg"

Which of the two values ​​examples shows better performance?

If one of them is faster, why?

Elasticsearch version: 7.2.0

data node : 30

coordinating node(for search) : 8

coordinating node(for index) : 4

master node: 3

ingest node: 1

main shards: 15

replicas: 3

shards per node: 2

average document count: 324,000,000

average request per second: 60

7
  • 1
    It's impossible to say, it depends on too many factors (number of documents, sizing of the nodes, number of client requests per sec, complexity of the queries, etc, etc, etc). Can you explain what are you trying to achieve exactly? Commented Jun 24, 2020 at 3:31
  • @Val I am checking performance tuning elements to improve search performance. Commented Jun 24, 2020 at 3:36
  • Can you explain what makes you think that this part specifically hinders your performance? Commented Jun 24, 2020 at 3:37
  • @Val The two examples mentioned above give the same search results, but are just curious as to whether there are any performance differences. Commented Jun 24, 2020 at 3:45
  • @YunjinJang can you provide the value of took param in search response of both queries ? Commented Jun 24, 2020 at 4:19

1 Answer 1

2

The best way to find out is simply to try it out. Create two indexes with the same amount of documents and test your queries on each of them.

In your case, you can create the second index, simply be reindexing the existing one into a second one with an ingest pipeline that transforms your string into an array, like this:

PUT _ingest/pipeline/to-array
{
  "processors": [
    {
      "split": {
        "field": "brandKeyword",
        "separator": "\\s+" 
      }
    }
  ]
}

Then you can reindex your data into the second index:

POST _reindex
{
  "source": {
    "index": "source"
  },
  "dest": {
    "index": "dest",
    "pipeline": "to-array"
  }
}

You now have two indexes, one with brandKeyword as a string and another one with brandKeyword as an array. You can test away and figure out which one performs better in your current environment.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.