Page 1 of 1

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 11:10 am
by sroth
I would like to find words beginning with punctuation such as
?uestlove
*NSYNC

I when searching on LIKEP *NSYNC, I get this error:
Query `*NSYNC' would require linear dictionary search: Index expression(s) match non-prefix substring of term `*nsync'


I also tried ecaping the * with \*, same error.

Do I need to add a specific index expression to handle this?

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 11:46 am
by Kai
If your Webinator version has it, set Allow Leading Wildcards to Y under All Walk Settings. This will allow leading-wildcard searches such as `*nsync'. These searches are normally disabled, because they require a linear dictionary search: this can be slower than a normal (binary-dictionary) index search, though it is not as slow as a full linear search.

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 11:51 am
by sroth
Thanks, I'm not using vortex script. Is there and equivalent apicp setting? Do I need this set when creating the index or just when running the query?

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 11:51 am
by John
There are a few settings you would need to set to allow leading wildcards:

set allineardict=1;
set qminprelen=0;
set wildsingle=1;

Which allow a linear scan of the dictionary to find the terms, and resticting wild-cards to a single word.

The ? charcter does not match any single character in the LIKEP syntax, so you would need to use *uestlove

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 11:54 am
by sroth
Sorry, typo. I meant to say I am using vortex script not webinator.

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 12:12 pm
by sroth
I'm now setting these for the query, but still get the same error.

<!-- 202 /test/search:173: set likepallmatch=1; -->
<!-- 202 /test/search:175: set allineardict=1; -->
<!-- 202 /test/search:176: set qminprelen=0; -->
<!-- 202 /test/search:177: set wildsingle=1; -->

'prefixes less than 2 characters (*NSYNC)' not allowed in query

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 12:51 pm
by Kai
Make sure you set any APICP settings via <apicp> where possible, instead of <sql "set ...">, as the latter may not propagate properly all the time. E.g. qminprelen is settable via <apicp>, whereas wildsingle is not, so they should be set thusly:

<sql "set wildsingle=1"></sql>
<apicp qminprelen 0>

Search Works Beginning with Punctuation

Posted: Wed Oct 29, 2014 12:56 pm
by sroth
using <apicp qminprelen 0> fixed it. Thanks.