nck-2 / test-rep

0 stars 0 forks source link

Research why Elastic is faster than Manticore for a single keyword search phrase #1354

Open githubmanticore opened 1 year ago

githubmanticore commented 1 year ago

The task is to understand how Lucene and Elastic provide few times lower latency for a single keyword search against a single index. E.g.:

snikolaev@dev:~$ time mysql -P9314 -h0 -e "select * from full where match('@comment_text it') option max_matches=10; show meta;" 
... 
real    0m0.461s 
user    0m0.003s 
sys    0m0.000s 

ES: 
snikolaev@dev:~$ time curl -s -XGET "http://localhost:9200/full/_search?pretty" -H 'Content-Type: application/json' -d ' 
{ 
  "size": 10, 
  "query": { 
    "simple_query_string": { 
      "fields": ["comment_text"], 
      "query": "it", 
      "default_operator": "and" 
    } 
  } 
}' 
... 
real    0m0.136s 
user    0m0.005s 
sys    0m0.000s 

Here's some info on how Lucene works https://stackoverflow.com/questions/2602253/how-does-lucene-index-documents/43203339#43203339