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

Custom analyzers in Elasticsearch no longer work #17012

Closed
MikeAlhayek opened this issue Nov 14, 2024 · 2 comments · Fixed by #17013
Closed

Custom analyzers in Elasticsearch no longer work #17012

MikeAlhayek opened this issue Nov 14, 2024 · 2 comments · Fixed by #17013
Labels
Milestone

Comments

@MikeAlhayek
Copy link
Member

Describe the bug

When specifying a custom analyzer in Elasticsearch as explained here https://docs.orchardcore.net/en/latest/reference/modules/Elasticsearch/#elasticsearch-analyzers it does create that custom analyzer in the Elasticsearch service.

Orchard Core version

2.x

To Reproduce

Configure custom analyzer like this:

"OrchardCore_Elasticsearch": {
      // Other settings
      "Analyzers": {
        "standard": {
          "type": "standard"
        },
        "keyword": {
          "type": "keyword"
        },
        "whitespace": {
          "type": "whitespace"
        },
        "knowledgebase_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "stop"
          ],
          "char_filter": [
            "html_strip"
          ]
        }
      }
    }

Create an index using the custom knowledgebase_analyzer. Now try to search for anything you'll get an error

[multi_match] analyzer [knowledgebase_analyzer] not found

This issue was caused by PR #16843

@MikeAlhayek MikeAlhayek added this to the 2.1 milestone Nov 14, 2024
Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@denispetrische
Copy link
Contributor

denispetrische commented Nov 14, 2024

I applied this configuration

"OrchardCore_Elasticsearch": {
  "ConnectionType": "SingleNodeConnectionPool",
  "Url": "http://localhost",
  "Ports": [ 9200 ],
  "Analyzers": {
    "standard": {
      "type": "standard"
    },
    "keyword": {
      "type": "keyword"
    },
    "whitespace": {
      "type": "whitespace"
    },
    "knowledgebase_analyzer": {
      "type": "custom",
      "tokenizer": "standard",
      "filter": [
        "lowercase",
        "stop"
      ],
      "char_filter": [
        "html_strip"
      ]
    }
  }
}

Created index with knowledgebase_analyzer
image

We can see that analyzer were created under name "default", it is necessary because for now there is no mechanism to specify concrete field for analyzer to be applied.

image

You can see also, that char filters are still not supported.

I created few Menu content Items, I can see them in the default_my index directly
image

I created a query and it works
image
image

I created also multimatch query
image
image

So... everything works fine

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

Successfully merging a pull request may close this issue.

2 participants