Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
:I added it but its failing because there is no tokenizer..which class should I add for my tokenizer? – user1050619 Aug 4 '14 at 1:56

Your Answer


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.