Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I write an example to be more practive. I need to know if it is possible to next search based on the data I have in my database, fulltextsearch engines in sqlserver-2008 or Apache Solr:

Case 1:

Data in the database:

Myriam
Miriam
Myrian
Miriam
...

Query:

Myria

Results that I want to return:

Myriam
Miriam
Myrian
Miriam

Case 2:

Data in the database:

Roberto Gonzalez
Roberto Perez
...

Query:

Robeto

Results that I want to return:

Roberto Bonzalez
Roberto Perez

I want to know if is possible to search in both engines and decide which of these work

Thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You can use text field type in Solr it will automaticly retrive results 'Myriam' or "Miriam" etc. If you use this field type in your solr schema it will tokenize your text and retrieve "roberto XXX" for "reberto" query

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
        <analyzer type="index">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
            <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.WhitespaceTokenizerFactory"/>
            <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
            <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
            <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
        </analyzer>
    </fieldType>
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.