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

Issue with boost settings #2542

Closed
rohitletsbuzz opened this issue Jan 12, 2013 · 0 comments

Comments

@rohitletsbuzz
Copy link

commented Jan 12, 2013

Hi,
I think this is an issue. I posted in the user group but got no response.
When the following query is created on an Index with lot of fields...

"bool" : {
    "must" : {
      "bool" : {
        "should" : [ {
          "bool" : {
            "must" : {
              "query_string" : {
                "query" : "\"microsoft\"",
                "fields" : [ "nameTokens" ],
                "analyzer" : "analyzerWithoutStop"
              }
            },
            "boost" : 5.0
          }
        }, {
          "bool" : {
            "should" : {
              "query_string" : {
                "query" : "\"insideview.com\"",
                "fields" : [ "companyDomain" ],
                "analyzer" : "analyzerWithoutStop"
              }
            },
            "boost" : 10.0
          }
        } ]
      }
    }
  }
}

On the "nameTokens" filed the boost parameter keeps increasing with the number of queries. Thats is

  1. When the query is fired for the first time. The explanation i got for the two results, one matched the "nameToken" clause and the other matched the "companyDomain" clause:

1st result

3.1991732 = (MATCH) product of:
  6.3983464 = (MATCH) sum of:
    6.3983464 = (MATCH) weight(companyDomain:insideview.com^10.0 in 223), product of:
      0.93694496 = queryWeight(companyDomain:insideview.com^10.0), product of:
        10.0 = boost
        6.8289456 = idf(docFreq=2, maxDocs=1020)
        0.013720199 = queryNorm
      6.8289456 = (MATCH) fieldWeight(companyDomain:insideview.com in 223), product of:
        1.0 = tf(termFreq(companyDomain:insideview.com)=1)
        6.8289456 = idf(docFreq=2, maxDocs=1020)
        1.0 = fieldNorm(field=companyDomain, doc=223)
  0.5 = coord(1/2)

2nd result

0.89017844 = (MATCH) product of:
  1.7803569 = (MATCH) sum of:
    1.7803569 = (MATCH) weight(nameTokens:microsoft^5.0 in 209), product of:
      0.3494771 = queryWeight(nameTokens:microsoft^5.0), product of:
        5.0 = boost
        5.0943446 = idf(docFreq=16, maxDocs=1020)
        0.013720199 = queryNorm
      5.0943446 = (MATCH) fieldWeight(nameTokens:microsoft in 209), product of:
        1.0 = tf(termFreq(nameTokens:microsoft)=1)
        5.0943446 = idf(docFreq=16, maxDocs=1020)
        1.0 = fieldNorm(field=nameTokens, doc=209)
  0.5 = coord(1/2)

2nd time the same search result is fired:

2.5471714 = (MATCH) product of:
  5.0943427 = (MATCH) sum of:
    5.0943427 = (MATCH) weight(nameTokens:microsoft^15625.0 in 209), product of:
      0.99999964 = queryWeight(nameTokens:microsoft^15625.0), product of:
        15625.0 = boost
        5.0943446 = idf(docFreq=16, maxDocs=1020)
        1.2562947E-5 = queryNorm
      5.0943446 = (MATCH) fieldWeight(nameTokens:microsoft in 209), product of:
        1.0 = tf(termFreq(nameTokens:microsoft)=1)
        5.0943446 = idf(docFreq=16, maxDocs=1020)
        1.0 = fieldNorm(field=nameTokens, doc=209)
  0.5 = coord(1/2)

2nd result

 0.0029293338 = (MATCH) product of:
  0.0058586677 = (MATCH) sum of:
    0.0058586677 = (MATCH) weight(companyDomain:insideview.com^10.0 in 223), product of:
      8.5791684E-4 = queryWeight(companyDomain:insideview.com^10.0), product of:
        10.0 = boost
        6.8289456 = idf(docFreq=2, maxDocs=1020)
        1.2562947E-5 = queryNorm
      6.8289456 = (MATCH) fieldWeight(companyDomain:insideview.com in 223), product of:
        1.0 = tf(termFreq(companyDomain:insideview.com)=1)
        6.8289456 = idf(docFreq=2, maxDocs=1020)
        1.0 = fieldNorm(field=companyDomain, doc=223)
  0.5 = coord(1/2)

If you look at the boost parameter in the query explanation, it is increasing with every query of one clause.

@clintongormley clintongormley added the bug label Jul 4, 2014
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Jul 4, 2014
… mutable changing the query else where in the execution path changes the instance in the cache too.

Instead the query parser cache should return a cloned instances.

Closes elastic#2542
martijnvg added a commit that referenced this issue Jul 4, 2014
… mutable changing the query else where in the execution path changes the instance in the cache too.

Instead the query parser cache should return a cloned instances.

Closes #2542
Closes #6733
@martijnvg martijnvg closed this in 730b83c Jul 4, 2014
martijnvg added a commit that referenced this issue Jul 4, 2014
… mutable changing the query else where in the execution path changes the instance in the cache too.

Instead the query parser cache should return a cloned instances.

Closes #2542
Closes #6733
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
… mutable changing the query else where in the execution path changes the instance in the cache too.

Instead the query parser cache should return a cloned instances.

Closes elastic#2542
Closes elastic#6733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.