Skip to content

Same configuration returned different hits #359

Open
@rammi22

Description

@rammi22

Hi,

i also ask the question in the elasticsearch discuss.

I execute a query within the extension elasticvue with following code:

{
	"query": {
		"bool": {
			"should": [
				{
					"wildcard": {
						"data.mainl.behavior": "*ro*"
					}
				},
				{
					"wildcard": {
						"data.detail.userparam": "*ro*"
					}
				},
				{
					"wildcard": {
						"data.detail.auth": "*ro*"
					}
				},
				{
					"wildcard": {
						"data.detail.address": "*ro*"
					}
				},
				{
					"wildcard": {
						"data.detail.invoice": "*ro*"
					}
				}
			],
			"must_not": {
				"term": {
					"data.main.refType": 1
				}
			}
		}
	},
	"size": 1000,
	"from": 0,
	"sort": []
}

that works as expected: 16 hits

Now, the same (at least i think so) configuration within the library (reading the query with Search::getQueries()):

{ONGR\ElasticsearchDSL\Query\Compound\BoolQuery} [2]
 container = {array} [2]
  should = {array} [5]
   97bea8d7588516e5a9bb067d602f933a81993d024dd7a2ddb87827baae1a = {ONGR\ElasticsearchDSL\Query\TermLevel\WildcardQuery} [3]
    field = "data.main.behavior"
    value = "*ro*"
    parameters = {array} [0]
   52886f8f83940699703d68554cdaa5da6c1b4d7eeaed75fc7736cbc729dc = {ONGR\ElasticsearchDSL\Query\TermLevel\WildcardQuery} [3]
    field = "data.detail.address"
    value = "*ro*"
    parameters = {array} [0]
   e718e888e74896efffc944965ef2022124d2e29983ca386ee0b4881b6429 = {ONGR\ElasticsearchDSL\Query\TermLevel\WildcardQuery} [3]
    field = "data.detail.auth"
    value = "*ro*"
    parameters = {array} [0]
   6bcc9e923b2a4b300f8eb481930ceb6b2b0501669572c4ede776e211816d = {ONGR\ElasticsearchDSL\Query\TermLevel\WildcardQuery} [3]
    field = "data.detail.invoice"
    value = "*ro*"
    parameters = {array} [0]
   b2156e1c12f811c6727d2627040c673e37dc14f3751f8b1b6d23b987ffaf = {ONGR\ElasticsearchDSL\Query\TermLevel\WildcardQuery} [3]
    field = "data.detail.userparam"
    value = "*ro*"
    parameters = {array} [0]
  must_not = {array} [1]
   48ec5b82f6dff5d5b470af5a3f75a28dc1bc83dde144fa0c3f2b2d7a8519 = {ONGR\ElasticsearchDSL\Query\TermLevel\TermQuery} [3]
    field = "data.detail.refType"
    value = {int} 1
    parameters = {array} [0]
 parameters = {array} [0]

This query returned too many hits.

So what is wrong with the configuration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions