01-15-2011, 12:04 AM
The indexing is fantastic for searches of the type "Exact Phrase with Wildcards" but I would like to be able to search where the results come back in this order: Exact Entire Search Phrase Match (whole exact > partial word match) > All Words (order not important) > some (variable) words.
This will help because when sending the search query "cats dogs" some of the matches may be in reverse order so even "cats*dogs" won't match "dogs and cats" though this would be desirable.
Ideally, even if you just threw a bunch of words at it, the items that match the most of them would come to the top even if some didn't match. This would make the search much more "google-like".
To extract each word from the search query I would start with code like this:
Macro Macro79
But then I would have to run them through the Index Search in variable combinations and then figure out a way to remove the overlaps. Any suggestions for a strategy for this or am I underestimating the complexity of this problem.
Thanks for any suggestions or directions to go on this.
Stuart
This will help because when sending the search query "cats dogs" some of the matches may be in reverse order so even "cats*dogs" won't match "dogs and cats" though this would be desirable.
Ideally, even if you just threw a bunch of words at it, the items that match the most of them would come to the top even if some didn't match. This would make the search much more "google-like".
To extract each word from the search query I would start with code like this:
Macro Macro79
,str Query = "test phrase here";; from input box
str Pattern_1w = "\b\w+?\b"
ARRAY(str) arr_1w
int Total_1w = findrx(Query Pattern_1w 0 4 arr_1w)
out Total_1w
out "[][]"
for _i 0 Total_1w
,out arr_1w[0 _i]
But then I would have to run them through the Index Search in variable combinations and then figure out a way to remove the overlaps. Any suggestions for a strategy for this or am I underestimating the complexity of this problem.
Thanks for any suggestions or directions to go on this.
Stuart