Hello!
I have a data file which contains texts that have -,/
Is there an analyzer that I can use for wildcard or phrase searches for such texts?
Thanks,
Supriya
Hello!
I have a data file which contains texts that have -,/
Is there an analyzer that I can use for wildcard or phrase searches for such texts?
Thanks,
Supriya
Any ideas? I have analyzer set as lucene.keyword.
When I try searching 20-22 there are no results even when the string exists in the file.
I tried both regex and wildcard search.
@Karen_Huaulme
Index Definition:
{
"mappings": {
"dynamic": false,
"fields": {
"Text": {
"analyzer": "lucene.standard",
"multi": {
"englishAnalyzer": {
"analyzer": "lucene.english",
"type": "string"
},
"wildcardAnalyzer": {
"analyzer": "lucene.keyword",
"type": "string"
}
},
"type": "string"
}
}
}
}
Search Query:
[{$search: {
index: 'fts',
wildcard: {
query: '20?des*',
path: 'Text',
allowAnalyzedField:true
}
}}]
Example docs:
Code:"10000020"
Level:"PT"
Text:"22,20-desmolase deficiency"
Current:null
Code:"10000013"
Level:"PT"
Text:"17,20-desmolase deficiency"
Current:null
Thank you for helping me with it.
Best,
Supriya
Got this to work. I had to mention the type of analyzer in my path construction.
{
wildcard: {
"query": "*22-des*",
"path": {"value" : "Text", "multi" : "wildcardAnalyzer" },
allowAnalyzedField:true
}
}
@Supriya_Bansal, sorry for the late reply. Answering for posterity. You probably want the lucene.whitespace
analyzer.