Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

OnlyWholeWords=false returns fewer hits

Vote:
 

I am currently working on a EPi 6 site, which has been upgraded from 4 to 5 and then to 6.

The search seems to be working fine with one strange exception: When I de-select the "only whole words" option I get fewer its on some words. In my view that makes no sence at all.

Any suggestions?

The check box:

<asp:CheckBox Runat="server" ID="OnlyWholeWords" Checked="true" />

The search data source:

<episerver:SearchDataSource Runat="server" ID="SearchResults" IncludeRootPage="true" AccessLevel="Read" EnableVisibleInMenu="false"> 

    <SelectParameters>

            <asp:ControlParameter Name="SearchQuery" ControlID="txtSearchQuery" PropertyName="Text" />

            <asp:ControlParameter name="SearchFiles" Controlid="SearchFiles" PropertyName="Checked"/>

           <asp:ControlParameter name="OnlyWholeWords" Controlid="OnlyWholeWords" PropertyName="Checked"/>

            <EPiServer:PropertyParameter Name="PageLink" PropertyName="MainContainer" />

    </SelectParameters>

</episerver:SearchDataSource>

#46393
Dec 09, 2010 13:50
Vote:
 

This is a good time to point out that the EPiServer Search is, to put it gently, not on par with the other features in EPiServer, qualitywise.

Leaving that significant detail for now, here's a suggestion-
I researched the inner workings of the search a while back, and I seem to recall that the search words are cleaned through a regex and then used directly in an SQL query. Knowing that, I tried to search for incomplete words using the SQL wildcard '%' on both sides of the word, and it seems to work fine.

This means you'll probably be able to skip the OnlyWholeWords parameter alltogheter and just write a little bit of logic that appends '%' characters to the beginning and end of your search words if the checkbox is checked.

I haven't tested this thoroughly, but it's worth a shot.

#46398
Dec 09, 2010 19:06
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.