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

Match phrase prefix query seems to ignore boost value. #13129

Closed
mohittt8 opened this issue Aug 26, 2015 · 2 comments
Closed

Match phrase prefix query seems to ignore boost value. #13129

mohittt8 opened this issue Aug 26, 2015 · 2 comments
Assignees
Labels
>bug good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories

Comments

@mohittt8
Copy link

There seems to be no effect on score on changing boost value on match_phrase_prefix query.

My query is:

 "query": {
        "bool": {
            "should": [
                {"match_phrase_prefix": {
                        "firstName": {
                            "query": "is", 
                            "boost":2.0
                        }
                    }} ,
                    {"match_phrase_prefix": {
                        "userName.raw": {
                            "query": "Tiv", 
                            "boost":4.0
                        }
                    }}
              ]
        }
    }

I am trying this on Elasticsearch-1.7

@clintongormley
Copy link

Boost does seem to be ignored by the match_phrase_prefix query:

PUT t/t/1
{
  "one": "foo",
  "two": "bar"
}

GET t/_search?explain
{
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "one": {
              "query": "foo",
              "boost": 5
            }
          }
        },
        {
          "match_phrase_prefix": {
            "two": {
              "query": "bar",
              "boost": 50
            }
          }
        }
      ]
    }
  }
}

@clintongormley
Copy link

This is also broken in master

@clintongormley clintongormley added the good first issue low hanging fruit label Aug 27, 2015
@javanna javanna self-assigned this Aug 27, 2015
@javanna javanna removed the help wanted adoptme label Aug 27, 2015
javanna added a commit to javanna/elasticsearch that referenced this issue Sep 3, 2015
The match_phrase_prefix query properly parses the boost etc. but it loses it in its rewrite method. Fixed that by setting the orginal boost to the rewritten query before returning it. Also cleaned up some warning in MultiPhrasePrefixQuery.

Closes elastic#13129
Closes elastic#13142
javanna added a commit to javanna/elasticsearch that referenced this issue Sep 3, 2015
The match_phrase_prefix query properly parses the boost etc. but it loses it in its rewrite method. Fixed that by setting the orginal boost to the rewritten query before returning it. Also cleaned up some warning in MultiPhrasePrefixQuery.

Closes elastic#13129
Closes elastic#13142
javanna added a commit to javanna/elasticsearch that referenced this issue Sep 3, 2015
The match_phrase_prefix query properly parses the boost etc. but it loses it in its rewrite method. Fixed that by setting the orginal boost to the rewritten query before returning it. Also cleaned up some warning in MultiPhrasePrefixQuery.

Closes elastic#13129
Closes elastic#13142
@javanna javanna closed this as completed in da554fc Sep 3, 2015
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query DSL labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug good first issue low hanging fruit :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants