Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same configuration returned different hits #359

Open
rammi22 opened this issue Jun 9, 2021 · 1 comment
Open

Same configuration returned different hits #359

rammi22 opened this issue Jun 9, 2021 · 1 comment

Comments

@rammi22
Copy link

rammi22 commented Jun 9, 2021

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?

@rammi22
Copy link
Author

rammi22 commented Jun 9, 2021

Done, the field path was wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant