1

For example, I if search for "Lord of the Rings", I will get no results, but if search just "Lord", or "Rings", I will get the results.

Can't locate what could be the issue.

Update, I finally got the expection out:

{
  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "failed to create query: field:[sku] was indexed without position data; cannot run PhraseQuery",
        "index_uuid": "znhJmQSgS4C07uL1bTJ_bw",
        "index": "magento2_product_1_v8"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "magento2_product_1_v8",
        "node": "AS3yhH-9SP-3qRZ6Pytg3g",
        "reason": {
          "type": "query_shard_exception",
          "reason": "failed to create query: field:[sku] was indexed without position data; cannot run PhraseQuery",
          "index_uuid": "znhJmQSgS4C07uL1bTJ_bw",
          "index": "magento2_product_1_v8",
          "caused_by": {
            "type": "illegal_state_exception",
            "reason": "field:[sku] was indexed without position data; cannot run PhraseQuery"
          }
        }
      }
    ]
  },
  "status": 400
}

2 Answers 2

1

I manage to fix it. If you have some custom attributes in catalog, you should include them in the search so they can be properly indexed.

4
  • Can you explain more about this issue? Because I am facing the same issue in my project. Commented Oct 19, 2020 at 11:08
  • 1
    As I said, I have a custom attribute (in my case its sku) and that attribute wasn't included in the search. Check here how to include attribute in the seach: magento.stackexchange.com/a/90043/82810
    – Zdravko
    Commented Oct 20, 2020 at 12:13
  • 1
    Thank you, bro my issue is resolved. Commented Oct 21, 2020 at 7:10
  • @Zdravko sku isn't really a custom attribute though, and you can't remove this attribute from search in the first place, so I'm unsure how you managed to do that..
    – Erfan
    Commented Nov 22, 2021 at 8:50
0

Have you tried any of these commands? "bin/magento indexer:reindex" or "bin/magento indexer:reindex catalogsearch_fulltext"

1
  • I did, I needed to do that in the first place.
    – Zdravko
    Commented Sep 28, 2020 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.