Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do searches return only objects with fields that start with my query string, rather than containing the query string anywhere in the field?

0
Posted

Why do searches return only objects with fields that start with my query string, rather than containing the query string anywhere in the field?

0

This behavior is intentional. The search interface goes directly into an SQL query, and thus support SQL wild card characters. Unless you query for a string at the beginning of a column, the index on that column won’t be used. So we default to only searching at the beginning of a field in order to take advantage of the speed provided by an index. However, you can get around this functionality in two ways. You can by put a ‘%’ in front of your search string, thereby forcing the SQL query to be a full substring query. Or you can enable on the “FULL_SEARCH” bricolage.conf directive and restart Bricolage. But know that either of these methods will a lot slower (though you probably won’t notice much until you have 1000s of documents).

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123