Most tokenizers would treat "?" as punctuation - to be ignored. The white space tokenizer will preserve all punctuation.

Or, use a raw string field ("string"/StrField).

In either case, you would need to escape the "?" in the query parser (with a backslash) since it is a wildcard character.

Yes, string_field:*\? should match any string field that ends with a "?".

-- Jack Krupansky

-----Original Message----- From: JZ
Sent: Wednesday, July 03, 2013 10:59 AM
To: solr-user@lucene.apache.org
Subject: Search for string ending with question mark

Hi all,

Currently, I am experimenting with the tokenizers.

Assume, I have the values: "2013?", "1900?", "87?".

I want to retrieve all values that end with the question mark as literal.

How do I need to define the <fieldType> in the schema.xml to allow for such
a query?

I assume it would be like: *\?

Is this possible in Lucene/Solr?

Cheers

Reply via email to