Search code examples
apachesolrlucenesolrj

Search for specific string solr


i'm usig Apache Solr. I would like search for a specific text in a string:

for example i use the query

title:"Hello" and the result are 3 because it search 'Hello' in all titles, but i want only one result ---> "Hello"

have I to change the schema.xml? Or is there a specific query that tries to string?


Solution

  • Define title in Solr Schema as below

    <field name="title" type="string" indexed="true" stored="true"/>
    

    Now title:"Hello" will match exactly Hello