The various word search entries contain words. Punctuation marks word 
boundaries, so the word index simply doesn't contain punctuation. Even the 
full-text phrase index leaves out any punctuation as it indexes pairs of words. 
Range indexes on strings in a punctuation-sensitive collation will contain 
punctuation, but that doesn't do you much good.

As with most search problems you can try to address this at index time or at 
query time. To change the index behavior you could use 
http://docs.marklogic.com/guide/search-dev/custom-dictionaries to create custom 
stemming entries. For example you could create an entry that maps 'basketball' 
to 'basket-ball'. That custom dictionary would change the index behavior, and 
has to enumerate every possibility that you want to handle.

Or you could change query behavior by using 
http://docs.marklogic.com/guide/search-dev/thesaurus or by writing custom 
query-expansion code. For example that could handle mapping 'basket-ball' to 
cts:word-query('basket-ball', 'basketball'). A thesaurus would enumerate every 
possibility that you want to handle. Custom code might be more general, and you 
might find a practical way to split 'basketball' into 
cts:word-query('basket-ball', 'basketball') as well.

To integrate query expansion with the search:* functions, use search:parse, 
then you expansion function, then search:resolve. This is a little more code 
than calling search:search, but shouldn't much affect performance.

Because the custom dictionary would map one way, and a query expansion would 
find it easiest to map the other way, you might decide to use both.

-- Mike

On 23 Dec 2012, at 00:52 , Mariano Grau Calín <[email protected]> wrote:

> Do it is possible that searches are insensitive to words written with and 
> without hyphens?
> By example, i desires that documents containing basket-ball and basketball 
> match the same search.
> 
> I'm using search:search() function and not found a term-option for this. I 
> tried <term-option>punctuacion-insensitive</term-option> but i do not know 
> all the options.

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to