Slow query

why wildcard query is taking too much time to get large number of documents
I have a query

{ "query": {
"bool": {
"must": [
{
"wildcard": {
"Item.HinTitleLink": "songs.pk"
}
}
]
}
},
"from": 0,
"size": 1000
}
result

{

  • took: 2812
  • timed_out: false
  • _shards: {
    • total: 5
    • successful: 5
    • failed: 0
      }

when I increase size to 10000 it does not execute at all.

Sending back 10000 docs to a user is just scary.
I can't read 1000 results.

Seems that you want to extract documents for your use case.
Have a look at the scan & scroll features.

HTH
David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 18 mai 2012 à 08:22, jajoria abhishek jajoria.abhishek@gmail.com a écrit :

why wildcard query is taking too much time to get large number of documents
I have a query

{ "query": {
"bool": {
"must": [
{
"wildcard": {
"Item.HinTitleLink": "songs.pk"
}
}
]
}
},
"from": 0,
"size": 1000
}
result

{
took: 2812
timed_out: false
_shards: {
total: 5
successful: 5
failed: 0
}
when I increase size to 10000 it does not execute at all.

wildcard queries are slow, especially one with leading wildcards. Try and
use ngram based analysis to "simulate" wildcard.

On Fri, May 18, 2012 at 8:22 AM, jajoria abhishek <
jajoria.abhishek@gmail.com> wrote:

why wildcard query is taking too much time to get large number of
documents
I have a query

{ "query": {
"bool": {
"must": [
{
"wildcard": {
"Item.HinTitleLink": "songs.pk"
}
}
]
}
},
"from": 0,
"size": 1000
}
result

{

  • took: 2812
  • timed_out: false
  • _shards: {
    • total: 5
    • successful: 5
    • failed: 0
      }

when I increase size to 10000 it does not execute at all.