elasticsearch


Empty search string not yielding all documents in Elasticsearch


I'm using Elastica's query builder to create queries for ElasticSearch (version 5.3)
I've around 1600 documents indexed in a particular index and type,
When I perform a search in that index with a empty string in query, I only get around 440 hits,
The generated query is:
{
"query": {
"bool": {
"should": [{
"multi_match": {
"query": "",
"fields": ["<field_1>^5", "<field_2>^4", "<field_3>^1", "<field_4>^2"],
"fuzziness": "AUTO"
}
}]
}
},
"from": 0,
"size": 20,
"aggs": {
"<agg_name_1>": {
"terms": {
"field": "<agg_field_1>"
}
},
"<agg_name_2>": {
"terms": {
"field": "<agg_field_2>"
}
},
"<agg_name_3>": {
"terms": {
"field": "<agg_field_3>"
}
},
"<agg_name_4>": {
"terms": {
"field": "<agg_field_4>"
}
},
"<agg_name_5>": {
"terms": {
"field": "<agg_field_5>"
}
},
"<date_agg_name>": {
"date_range": {
"field": "<agg_field_date_1>",
"keyed": true,
"ranges": [{
"from": "now\/d",
"key": "NOW\/DAY TO *"
}, {
"from": "now-2d\/d",
"key": "NOW\/DAY-2DAY TO *"
}, {
"from": "now-7d\/d",
"key": "NOW\/DAY-7DAY TO *"
}, {
"from": "now-30d\/d",
"key": "NOW\/DAY-30DAY TO *"
}]
}
},
"<agg_name_integer>": {
"range": {
"field": "<agg_field_integer>",
"keyed": true,
"ranges": [{
"to": 1,
"key": "1"
}, {
"to": 2,
"key": "2"
}, {
"to": 3,
"key": "3"
}, {
"to": 4,
"key": "4"
}, {
"to": 5,
"key": "5"
}]
}
}
}
}
I thought that since the query is empty string, it should match all the documents, but why is it only matching a subset of the document? I also tried changing should with must, but there was no difference.
Is it because of multi_match ? or fuzziness ? or fields ?
P. S. The actual name of fields are changed and replaced with placeholder.
If the query field is empty you can use match_all query
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-all-query.html
multi match does not work with empty keywords as far as i have noticed.

Related Links

Sort elasticsearch search hits by document count
Elastic search date range max, min date
Elastic search river mongodb _meta returning action not found error
Seeing many open Elasticsearch connections even after using singleton pattern
What would be a good approach for sending logs from multiple servers a centralized logging server?
does elasticsearch support queries of queries?
Data modelling with elastic search
match or term query on a long property for exact match?
Updating filtered documents in elasticsearch
Testing ElasticSearch custom analyzers
timestamp issue in elasticsearch
Elasticsearch NEST client singleton usage
Elasticsearch: suggest users based on likes
Set every property type to not_analyzed for custom object
How to tell ElasticSearch to create nested fields
Elasticsearch minimum master nodes

Categories

HOME
visual-studio
firebase
functional-programming
facebook-messenger
workflow
couchdb
selenium-builder
malware
linker
video-streaming
eddystone
scrape
graphdb
android-externalstorage
squirrel-sql
xbox360
mahout-recommender
gmp
gitkraken
nurbs
router
introspection
window-managers
unrar
tf-idf
bonita
sfml
materialize
monitor
autodesk-model-derivative
objectmapper
windows2012
buildforge
landscape
redgate
oauth2
stat
uipickerview
newtons-method
dagger
httphandler
oracle-bmcs
vesta
linq-to-excel
rightnow-crm
tinyioc
nothing
line-intersection
connect-direct
mechanicalturk
word-2016
prefetch
mifos
bigdecimal
okio
tsqlt
conan
maximize
apple-configurator
django-redis
currency-exchange-rates
onepage-checkout
lovefield
lowercase
cfwheels
modern.ie
angular-amd
shoes
password-recovery
mfmessagecomposeview
jack
roxy-fileman
strdup
facebook-game-groups
jquery-lazyload
ui-design
ckeditor.net
email-verification
user-forums
chronometer
acpi
servercontrol
qcar-sdk
aggregator
tessellation
raw-data
autobench
prism-2
comment-conventions
community-server
rootkit

Resources

Encrypt Message