Question

Hey Guys, Im trying to implement some search functionality to an application were writing.

Solr 1.4.1 running on Tomcat7 JDBC connection to a MS SQLServer with the View im indexing Solr has finished indexing and the index is working.

To search and communicate with Solr i have created a little test WCF service (to be implemented with our main service later).

The purpose is to implement a textfield in our main application. In this text field the users can start typing something like Paintbrush and gradually filter through the list of objects as more and more characters are input.

This is working just fine and dandy with Solr up to a certain point. Im using the Wildcard asterisk in the end of my query and as such im throwing a lot of requests like p* pa* pain* paint*

etc. at the server and its returning results just fine (quite impressively fast actually). The only problem is that once the user types the whole word the query is paintbrush* at which point solr returns 0 results.

So it seems that query+wildcard can only be query+something and not query+nothing

I managed to get this working under Lucene.Net but Solr isnt doing things the same way it seems.

Any advice you can give me on implementing such a feature?

there isn't much code to look at since im using SolrNet: http://pastebin.com/tXpe4YUe

I figure it has something to do with the Analyzer and Parser but im not yet that into Solr to know where to look :)

Was it helpful?

Solution 2

Stemming seems to be what caused the problem. I fixed it using a clone of text_ws instead of text for the type. My changes to scema.xml : http://pastebin.com/xaJZDgY4

Stemming is disabled and lowercase indexing is enabled. As long as all queries are in lower case they should always give results (if there at all).

Issue seems to be that Analyzers dont work with Wildcards, so the logic that would make Johnny the result of Johni or Johnni is "broken" when using wildcards.

If your facing similiar problems and my solution here doesnt quite work you can add debugQuery=on to your query string and see a bit more about whats going on. That helped me narrow down the problem.

OTHER TIPS

I wouldn't implement suggestions with prefix wildcard queries in Solr. There are other mechanisms better suited to do this. See:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top