I gave you bad advice about qt=. Erik Hatcher kindly corrected me: >> Actually qt selects the request handler. defType selects the query parser. >> qt may implicitly select a query parser of course, but that would depend on >> the request handler definition.
On Wed, Feb 10, 2010 at 1:10 PM, Stefan Maric <sma...@ntlworld.com> wrote: > Lance > > after a bit more reading - & cleaning up my configuration (case sensitivity > corrected but didn't appear to be affecting the indexing & i don't use the > atomID field for querying anyhow) > > I've added a docType field when I index my data and now use the fq parameter > to filter on that new field > > > > > > -----Original Message----- > From: Lance Norskog [mailto:goks...@gmail.com] > Sent: 10 February 2010 03:28 > To: solr-user@lucene.apache.org > Subject: Re: Indexing / querying multiple data types > > > A couple of minor problems: > > The qt parameter (Que Tee) selects the parser for the q (Q for query) > parameter. I think you mean 'qf': > > http://wiki.apache.org/solr/DisMaxRequestHandler#qf_.28Query_Fields.29 > > Another problems with atomID, atomId, atomid: Solr field names are > case-sensitive. I don't know how this plays out. > > Now, to the main part: the <entity name="name1"> part does not create > a column named name1. > The two queries only populate the same namespace of four fields: id, > atomID, name, description. > > If you want data from each entity to have a constant field > distinguishing it, you have to create a new field with a constant > value. You do this with the TemplateTransformer. > > http://wiki.apache.org/solr/DataImportHandler#TemplateTransformer > > Add this as an entity attribute to both entities: > transformer="TemplateTransformer" > and add this as a column to each entity: > <field column="name" template="name1"> and then "name2". > > You may have to do something else for these to appear in the document. > > On Tue, Feb 9, 2010 at 12:41 AM, <stefan.ma...@bt.com> wrote: >> Sven >> >> In my data-config.xml I have the following >> <document > >> <entity name="name1" query="select id, atomID, name, >> description from v_1" /> >> <entity name="name2" query="select id, atomID, name, >> description from V_2" /> >> </document> >> >> In my schema.xml I have >> <field name="id" type="string" indexed="true" stored="true" >> required="true" /> >> <field name="name" type="text" indexed="true" stored="true"/> >> <field name="atomId" type="string" indexed="false" stored="true" >> required="true" /> >> <field name="description" type="text" indexed="true" stored="true" /> >> >> And in my solrconfig.xml I have >> <requestHandler name="/dataimport" >> class="org.apache.solr.handler.dataimport.DataImportHandler"> >> <lst name="defaults"> >> <str name="config">data-config.xml</str> >> </lst> >> </requestHandler> >> >> <requestHandler name="name1" class="solr.SearchHandler" > >> <lst name="defaults"> >> <str name="defType">dismax</str> >> <str name="echoParams">explicit</str> >> <float name="tie">0.01</float> >> <str name="qf">name^1.5 description^1.0</str> >> </lst> >> </requestHandler> >> >> <requestHandler name="contacts" class="solr.SearchHandler" > >> <lst name="defaults"> >> <str name="defType">dismax</str> >> <str name="echoParams">explicit</str> >> <float name="tie">0.01</float> >> <str name="qf">name^1.5 description^1.0</str> >> </lst> >> </requestHandler> >> >> And the >> <requestHandler name="dismax" class="solr.SearchHandler" > >> Has been untouched >> >> So when I run >> http://localhost:7001/solr/select/?q=food&qt=name1 >> I was expecting to get results form the data that had been indexed by >> <entity name="name1" >> >> >> Regards >> Stefan Maric >> > > > > -- > Lance Norskog > goks...@gmail.com > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.435 / Virus Database: 271.1.1/2677 - Release Date: 02/09/10 > 07:35:00 > > > -- Lance Norskog goks...@gmail.com