0
votes

I have 2 documents in my db:

ID | FIELD | VALUE
---------------------------
1  | title | something else
2  | title | something blah

Query 1: If i run the Lucene query: title:"something else"

  • It finds document with ID 1.

Query 2: If i run the Lucene query: title:"something els"

  • It does not find any documents.

Query 3: If i run the Lucene query: title:"something els*"

  • It does not find any documents.

What could be going wrong?

I would expect to see Query 2 and 3 return document with ID 1

Notes:

title: something else is returned from the content searcher that Umbraco shows.

1
Query 2 doesn't work because the term "els" doesn't match "else". Query 3 doesn't work because the standard query parser doesn't support wildcards in phrases (that is, within quotes). Complex Phrase query parser would do the job, or you may need to change your analyzer (not sure what Umbraco supports).femtoRgon

1 Answers

0
votes

In the backend ExamineManager searcher you can choose 'lucene' search instead of text search and the wildcard will work (so too will all lucene query syntax)

You can do this manually in your own code via:

this.examineManager
    .SearchProviderCollection["ExternalSearcher"]
    .CreateSearchCriteria(type)
    .RawQuery(query)

But that will accept all lucene syntax (something you may not want to do).