lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fornoville, Tom" <Tom.Fornovi...@truvo.com>
Subject RE: Quering the database
Date Mon, 02 Aug 2010 12:31:47 GMT
This question has come up several times over the past weeks.

The cause is probably all your fields being of type "string".
This is only good for exact matches like id's etc.
Try using "text" or another type that tokenizes.

-----Original Message-----
From: Hando420 [mailto:hando420@gmail.com] 
Sent: maandag 2 augustus 2010 13:42
To: solr-user@lucene.apache.org
Subject: Re: Quering the database


Thank you for your reply.

Below is my data-config details.

<dataConfig>
  <dataSource type="JdbcDataSource" 
              driver="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost/userSearch" 
              user="root" 
              password="root" batchSize="-1"/>
			  
  <document>
    <entity name="search_result" pk="page_url" 
	
            query="select title, cast(content as char) as
content,page_url
from search_result"
			
	
	<field column="title" name="field_1"/>
	<field column="content" name="field_2"/>
	<field column="page_url" name="field_3"/>
    </entity>
  </document>
</dataConfig>

Below are the defined schema fields for the data-config

   <fields>
  <field name="field_1" type="string" indexed="true" stored="true"
required="true"/>
   <field name="field_2" type="string" indexed="true" stored="true"/>
     <field name="field_3" type="string" indexed="true" stored="true"/>
 </fields>
 <uniqueKey>field_1</uniqueKey>

 <!-- field for the QueryParser to use when an explicit fieldname is
absent
-->
 <defaultSearchField>text</defaultSearchField>
-- 
View this message in context:
http://lucene.472066.n3.nabble.com/Quering-the-database-tp1015636p101567
1.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message