You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by trukmuch <da...@vinci-energies.com> on 2013/05/13 15:20:29 UTC

Solr fullname search

Hi,
I'm trying to set up a fullname search in Solr. Until now I thought my work
was fine until I've found something strange, and I can't figure out how to
correct it.

So I want to be able to do searches on full names. My index is a database
where I get first name and last name and put them in one multivalued field
with keyword tokenizer.

Here's my fieldtype :
<fieldType name="text_auto" class="solr.TextField">
  <analyzer>
    <tokenizer class="solr.KeywordTokenizerFactory"/>
    <filter class="solr.ASCIIFoldingFilterFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

 Everything works fine, I can search only a first name OR lastname and it
gives me the full names that exists, and it also works for full names in any
order if there's no mispelling.

I just noticed something wrong ! For example, if I ask for Dupont dupont,
it'll give me every Dupont that exists, even the ones for which the first
name doesn't match with dupont. It seems that for each word in the query, it
searches in the full name once. The problem is that if they're looking for
"dupont d", they'll find every Dupont that exist because "d" is contained in
Dupont ! That's not what I want, in that case, I want to find every Dupont
with a d in their first name (the other string).

So I need to find a way to make it work, I tried many different tokenizers
and filters but I'm affraid it's not possible... FYI, I'm using SolrJ,
q.op=AND and wildcards (*) in front and behind every word queried. Thank you
for any help you could provide me !





--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-fullname-search-tp4062919.html
Sent from the Solr - User mailing list archive at Nabble.com.