It would be great to have possibility to search in custom fields and page content, eg. to provide website’s content search.
I looked into content panel, and tried similar query - sth like:
Thanks!
Right this case is resolved, but what if I’d like to search in multiple fields?
Based on builder admin query: query.$or[0].data.title.$regex: .*hubbahubba.*, query.$or[0].data.title.$options: i, query.$or[1].data.description.short.$regex: .*hubbahubba.*, query.$or[1].data.description.short.$options: i,
gives me nothing ; while:
query.data.title.$regex: .*hubbahubba.*, query.data.title.$options: i,
and query.data.description.short.$regex: .*hubbahubba.*, query.data.description.short.$options: i,
used separately - work.
At the moment I use $or, query stops working
Similarly - if I’d like to search eg. events that have date from and to specified: query.data.date.from.$gte: 1597425047724 AND query.data.date.to.$lte: 1597425047724
it works with one condition used, but I don’t know how to do logical AND. $and[0]? Doesn’t work
Last thing: If I’d like to search within page contents I have to query: query.data.blocks.$regex etc?
The above should work for $and as well. If it doesn’t - can you send a full example URL you are using so we can help you more specifically debug?
For a search of all content, you can use our (beta) search API that searches the full contents with elasticsearch. Note that elasticsearch doesn’t support partial word matching, so you must search full words. For example, you can search all of our docs that mention “Shopify” with this