A text field is a sequence of terms that has been tokenized while a string field is a single term (although it can also be multivalued.)

Punctuation and spacing is ignored for text fields. Text tends to be lowercased, stemmed, and even stop words removed. You tend to search text using a handful of keywords whose exact order is not required, although quoted phrases can be used as well. Fuzzy queries can be done on individual terms (words). Wildcards as well.

String fields are literal character strings with all punctuation, spacing, and case preserved. Anything other than exact match is done using wildcards, although I suppose fuzzy query should work as well.

String fields are useful for facets and filter queries or display.

Text fields are useful for keyword search.

Synonyms are a token filtering, which applies to text fields, not string fields.

A fuzzy query would not work properly for a synonym expansion in which some of the terms are phrases, but should otherwise work for a text field term.

If you have a specific case that fails, please provide the details.

-- Jack Krupansky

-----Original Message----- From: Gau
Sent: Wednesday, May 30, 2012 4:39 PM
To: solr-user@lucene.apache.org
Subject: Difference between textfield and strfield

Hi,

Can anyone explain me the basic pros and cons between textfield and
strfield. I am trying to use Levenstein distance on textfield, but it seems
that it can only be applied on the strfield. So my question is whats the
difference between the 2 and what are the radical advantages of one over the
other

Currently I have the text field defined for first_name and i apply synonym
expansion at query time to this field.

--
View this message in context: http://lucene.472066.n3.nabble.com/Difference-between-textfield-and-strfield-tp3986916.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to