Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I would like to search with only part of a word,not the whole word.For example when I search name of people,I would like to search only the first 3 letters of the Last Name,not the whole name.Now if I put on search only the first 3 letters I take no results.For the moment I am using the search api with apache solr(and perhaps views).Any suggestions please?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Add ngramfilter to text type definition in schema.xml in solr config directory.

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <filter class="solr.EdgeNGramFilterFactory" minGramSize="3" maxGramSize="25" />
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.