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

Orchard corrupts Elastic stemmer configuration #16384

Closed
Lenar-Avia opened this issue Jun 28, 2024 · 5 comments · Fixed by #16843
Closed

Orchard corrupts Elastic stemmer configuration #16384

Lenar-Avia opened this issue Jun 28, 2024 · 5 comments · Fixed by #16843
Milestone

Comments

@Lenar-Avia
Copy link

Lenar-Avia commented Jun 28, 2024

Describe the bug

Customer Elastic analyzers configuration from OrchardCore_Elasticsearch block gets corrupt

Orchard Core version

1.8.2

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'OrchardCore_Elasticsearch' section in configuration
  2. Try to set up simple stemmer analyzer, SPANISH for example, as explained at:
    https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-lang-analyzer.html#spanish-analyzer
  3. Make sure you have both "analyzer" and "filter" sections inside "analysis" block
  4. Save and apply configuration
  5. Check out current GET .../_settings of elastic - to find out there is no "analysis.filter" area.
    i.e. actual settings now do not contain "filter" area (on the same level as "analyzer")
  6. Check out the termvectors to see that no handling happened to substrings.

Expected behavior

I would expect the termvectors to be created using stemmer.
When directly setting config using PUT ../_settings , custom morphological analyzer can be applied.

Logs and screenshots

Please try to reproduce the following settings using OrchardCore_Elasticsearch:


"analysis": {
  "filter": {
	"spanish_stop": {
	  "type":       "stop",
	  "stopwords":  "_spanish_" 
	},
	"spanish_stemmer": {
	  "type":       "stemmer",
	  "language":   "light_spanish"
	}
  },
  "analyzer": {
	"default": {
	  "tokenizer":  "standard",
	  "filter": [
		"lowercase",
		"spanish_stop",
		"spanish_stemmer"
	  ]
	}
  }
}
Copy link
Contributor

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. A core team member will review your issue and get back to you.

If you like Orchard Core, please star our repo and join our community channels.

@Lenar-Avia Lenar-Avia changed the title Orchard corrups Elastic stemmer configuration Orchard corrupts Elastic stemmer configuration Jun 28, 2024
@MikeAlhayek
Copy link
Member

MikeAlhayek commented Jun 28, 2024

@Lenar-Avia I am not sure I follow your steps. But in order to create rebuilt_spanish you referenced, your configuration should look like the following:

"OrchardCore_Elasticsearch": {
  // ...
  "Analyzers": {
    "rebuilt_spanish": {
      "tokenizer":  "standard",
      "filter": [
        "lowercase",
        "spanish_stop",
        "spanish_keywords",
        "spanish_stemmer"
      ]
    }
  }
}

Can you see if the above works for you? Here is a reference from our documentation

@Lenar-Avia
Copy link
Author

Hello, dear!
Well if i supply the request as you have provided, without the Analysis.Filters area,
then exception happens when i try to rebuild the index.
definitions: "index_not_found_exception" , "no such index [index_name]"
Your request is incomplete without Filters.

Also you ignore the fact that only "default" analyzer is working in OrchardCMS config
(i.e. it cannot be called rebuilt_spanish).
Please try to get a working stemmer configuration before removing the bug tag..

@MikeAlhayek
Copy link
Member

Filters is not something we support in OC. Feel free to submit a PR that would add filters support in addition to the analyzers.

@MikeAlhayek MikeAlhayek added this to the 2.x milestone Jul 2, 2024
Copy link
Contributor

github-actions bot commented Jul 2, 2024

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.

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

Successfully merging a pull request may close this issue.

2 participants