Hi,
I'm stuck with a search problem and haven't found any solution reading the forum.
I added a search field in my ChronoConnectivity connection using that line in List Display :
And in my model settings, in "Searchable" I put :
The search works great but when I search for instance "word1 word2" in my search field and display the debug log it shows :
I'd like to override this to search "word1 AND word2" instead of "word1 OR word2", i.e :
Because when I search "word1" if I got 20 results, I want to reduce search results adding another word to aim relevant content (word1 AND word2) instead increasing results because it looks for "word1 OR word2 giving me for instance 50 results.
Any advice on how to override this part of the SQL ?
Thanks in advance for any help you are able to provide,
Arnaud
I'm stuck with a search problem and haven't found any solution reading the forum.
I added a search field in my ChronoConnectivity connection using that line in List Display :
<input type="text" id="filter_search" name="srch" placeholder="Search..." class="form-control" />
And in my model settings, in "Searchable" I put :
myModel.title
myModel.details
The search works great but when I search for instance "word1 word2" in my search field and display the debug log it shows :
[...]WHERE (
(`myModel`.`title` LIKE '%word1%') OR
(`myModel`.`details` LIKE '%word1%') OR
(`myModel`.`title` LIKE '%word2%') OR
(`myModel`.`details` LIKE '%word2%')
)[...]
I'd like to override this to search "word1 AND word2" instead of "word1 OR word2", i.e :
[...]WHERE (
((`myModel`.`title` LIKE '%word1%') OR (`myModel`.`details` LIKE '%word1%'))
AND
((`myModel`.`title` LIKE '%word2%') OR (`myModel`.`details` LIKE '%word2%'))
)[...]
Because when I search "word1" if I got 20 results, I want to reduce search results adding another word to aim relevant content (word1 AND word2) instead increasing results because it looks for "word1 OR word2 giving me for instance 50 results.
Any advice on how to override this part of the SQL ?
Thanks in advance for any help you are able to provide,
Arnaud