-
- 61 Posts
I'm using AdvSearch in Revolution and would like to run a search that carries a bit of relevance by running an AND query followed by an OR query, then combining the two results with the AND results running above the OR results. This way it would find exact matches ahead of possible matches.
I've been looking at the queryHook but what I'm trying to do seems like it may be above the scope of the examples I could find.
Anyone have thoughts on the best way to do this?
-
- 61 Posts
Thanks for your response coroico and thanks for writing this amazing search function. It's so comprehensive. This is the first time I've used it and I'm really impressed by it.
To pull an example from the demo pages: if I search "rock band" (but without the quotes) my ideal result set would be to return a single list of results in the following order with the duplicates removed:
- "rock band" (using the quotes)
- rock AND band
- rock OR band
This effectively is doing the work of 3 searches for the user and making some approximate decisions about what's most likely to be relevant.
What I'm currently trying is writing a snippet that actually runs 3 searches by calling the AdvSearch snippet 3 times with the different parameters. Using a TPL that just returns '[[+id]],' I can then explode that into an array of the three sets, remove the duplicates and cycle through those IDs with getResource to list the results.
It's a bit more manual but in my mind it will create a more precise search.
Am I missing something that automates some or all of this?
Thanks again!