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

[BUG] Match_phrase_prefix query on a text field with setting index_prefixes works not well #9218

Closed
gaobinlong opened this issue Aug 10, 2023 · 2 comments
Labels
bug Something isn't working untriaged

Comments

@gaobinlong
Copy link
Collaborator

Describe the bug
When executing match_pharse_prefix query on a text field with multiple values and with setting index_prefixed, the documents which should be hit are not returned, but if the search keyword hits the first element in the text field, the document will be returned.

To Reproduce
Steps to reproduce the behavior:

  1. Create a index with a text field which set index_prefixes using default properties.
PUT test11
{
  "mappings": {
    "properties": {
      "platform_name": {
        "type": "text",
        "index_prefixes": {}
      },
      "applications": {
        "properties": {
          "name": {
            "type": "text",
            "index_prefixes": {}
          },
          "app_version": {
            "type": "keyword"
          },
          "publisher": {
            "type": "text"
          }
        }
      }
    }
  }
}
  1. Add a doc
POST test11/_doc/3?refresh
{
  "platform_name": "Red Hat",
	"applications.name": ["python-libs","bind-libs"]
}
  1. Search the document, nothing will be returned
GET test11/_search
{
  "query": {
    "match_phrase_prefix": {
      "applications.name": "bind-libs"
    }
  }
}
  1. Add another doc, change the order of elements in the field applications.name, execute the query in step 3, this document will be returned.
POST test11/_doc/3?refresh
{
  "platform_name": "Red Hat",
	"applications.name": ["bind-libs","python-libs"]
}

Expected behavior
Return the document not matter the order of the elements in the text field when executing match_phrase_prefix query.
In addition, match_phrase query works well in this case.

Host/Environment (please complete the following information):

  • OS: [macOS]
  • Version [2.9]
@gaobinlong gaobinlong added bug Something isn't working untriaged labels Aug 10, 2023
@Ei5enheim
Copy link

Duplicate of: #9203

@gaobinlong
Copy link
Collaborator Author

Close this issue as it's duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

2 participants