Fuzzy Full Text Search

Is it possible to do a fuzzy full text search now by using var queries?

For those who don’t know, right now you can do a full text search by using anyoftext or alloftext in DQL (@hash / @exact). You can also do a fuzzy search by using the match function (@trigram), however it is one word only.

To me the match function is not that useful since most searches will contain more than 1 word. We need a match function that matches phrases like the full-text search.

Question

  1. Couldn’t we write a match function right now that matches all words by combining several match functions. Surely this has already been done? I do realize the words won’t necessarily be next to each other, but it is still the next best thing.
  2. Could we possibly store all our text fields without spaces (maybe -) to simulate larger words? Some trigram indexes count the space in the index. Would this blow up our database too much?
  3. Perhaps a mixture…
    a. Get all full-text results
    b. Get fuzzy results by matching results including all words
    c. Score full-text higher?

I realize we can’t score now by how many times the words are there, but we can score by closeness to the search phrase and not just search term

This does not take speed into account, just thinking about functionality.

Just some thoughts.

J

Related Posts:


1 Like