Ruben_FS
(Ruben Fs)
5
Thank you for your answer @amyjian . I have taken a look the documentation and I have found very useful information. I have created this search index:
{
"mappings": {
"fields": {
"isbn": {
"analyzer": "lucene.keyword",
"type": "string"
},
"title": {
"analyzer": "lucene.keyword",
"type": "string"
}
}
}
}
It looks that this was what I’m looking for. Doing this query I get the desired results, because I can search both in title and isbn fields.
[
{
$search: {
'index': 'mainSearchIndex',
'compound': {
'should': [
{
'regex': {
'path': 'isbn',
'query': '(.*)848327(.*)'
}
},
{
'regex': {
'path': 'title',
'query': '(.*)848327(.*)'
}
}
]
}
}
}
]
Any advice is welcome.