I've been getting very strange search results on our dev server, so I've been experimenting with ngram length. Any help would be appreciated. Here's what I've found:

  • With ngram length set to 3 (the default), search will return "testing" when searching for "test", but will not return "tutoring" when searching for "tutor".
  • With ngram length set to 4, search will return "tutoring" when searching for "tutor", but will not return "testing" when searching for "test".

I've also experimented with changing both "Assume missing letters" and "Assume extra letters" settings. What combination of ngram and other settings will allow search to return BOTH "testing" when searching for "test" and "tutoring" when searching for "tutor"?

Comments

awolfey’s picture

It's not the ngram length so much as it is the completeness percent. Check the readme for how this all works if you haven't read it yet.

gecko85’s picture

Ok, I've left ngram set to 3, and experimented with completeness percent. The highest completeness percent I can set where "tutoring" would be returned for "tutor" is 20. But, that introduces quite a bit of noise in other search results. I guess I'll just have to live with it.

awolfey’s picture

You should be able to match that with 40-50%. I haven't played much with fuzzysearch and views, so there may be something else going on. In a search_api search page you could configure to sort by score or completeness. Also note that the highlighting is separate from search and has its own misspelling percentage.

gecko85’s picture

Yeah, I would have thought 40 or 50 percent would do the trick, but it doesn't. I kept backing down 5% at a time, and 20% was the magic threshold. (This is in Search API-->Default fuzzysearch index-->Workflow-->Fuzzy Search search settings)

awolfey’s picture

If you can email me your node content using the contact form I'll try to find time to take a look, but I suspect that you just need to try some different adjustments for the search and excerpt settings.

awolfey’s picture

Status: Active » Postponed
timmetj’s picture

Hello,

I would like to add to this topic.

For me the search also return some strange behaviour.

ex: I have a node called "Bookshelf" and another called "Cornershelf".
When i search for "shelf" i get both result (and other results as wel).
When i search for "book" i only get "cornershelf" and other result where there isn't any match for book. And the most important "Bookshelf" i do not get as result.

I already played with the Search Settings setting them to 10 missing and 8 extra letters with a completeness of 30. This already gave me a better result then the default settings, but still i get this strange result on "book" and also getting results that don't even get close to the therm.