Hi,
I like to use synonym_path to assign a couple of synonyms to optimize my search.
My enviroment is setup with Elasticsearch 8.15.1 and FSCrawler and after some study I figure out that I can't add mapping as done in common tuturials as there's already a mapper assigned (by FSCrawler I think).
{
"error": {
"root_cause": [
{
"type": "mapper_exception",
"reason": "analyzer [my_synonym_analyzer] contains filters [my_synonym_filter] that are not allowed to run in index time mode."
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping: analyzer [my_synonym_analyzer] contains filters [my_synonym_filter] that are not allowed to run in index time mode.",
"caused_by": {
"type": "mapper_exception",
"reason": "analyzer [my_synonym_analyzer] contains filters [my_synonym_filter] that are not allowed to run in index time mode."
}
},
"status": 400
}
My issue is now to understand how I can handle to use my own synonyms.
Tutorials are rare and/or outdated and I'm a novice with Elastic/FSCrawler.
So what do you recommend is the best and a simple way to use own synonyms with Elasticsearch 8.15.1 and FSCrawler.
If you want to define your own index settings and mapping to set analyzers for example, you can update the needed component template before starting the FSCrawler .
What does before starting the FSCrawler means?
I have to delete the index and use before I first run of FSCrawler?
But in this case PUT _component_template/fscrawler_mapping_content_semantic won't work because of missing fscrawler settings, will it?
The setting "copy_to": "content_semantic" I've never meet before in any sample.
Is it requiered in any case?
Here are the steps (please note that this will remove any existing data).
If you don't have a trial or commercial license or running on cloud, then you don't have access to semantic search. I will assume that you don't do semantic search in the following instructions.
I suppose here that you have already ran FSCrawler at least once before and that the templates have been installed already. This is something you can check by running:
GET _component_template/fscrawler*
This should gives you a non empty list of components.
So, you want to add synonyms. The first thing to do is to add it to the existing "content" component template named fscrawler_mapping_content:
Yes, that it, thank you.
It's really great to make it work after a long time and I learned about how it work in general.
Anyway I note that there's much more to study for a deeper understanding ...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.