yes.. The above solution would help ..:) you can specify like http://localhost:8090/solr/select?indent=on&start=0&rows=10&q=landmark:landmark4&fl=landmark,user_id this will give u for each results set only landmark field and userId
And in solr console ,The Full Interface option, There you can try for useage of highlight... Regrds, Rajani Maski On Thu, Jul 29, 2010 at 1:01 PM, Bastian Spitzer <bspit...@magix.net> wrote: > You cant really. By searching you allways will find _documents_, and solr > will return all their stored > fields unless you specify which exact stored fields you want solr to return > by passing "&fl=" parameter > to your query. > > The only aproach i can think off is (mis)using highlighting, search for > hightlighted text in the landmarkX- > fields and then remove the fields that dont contain matches. Just add: > > &hl=true&hl.fl=landmark1,landmark2,landmark3 etc to your query, then you > will find a "highlighting" section > in your response. > > hope that helps > > -----Ursprüngliche Nachricht----- > Von: Jonty Rhods [mailto:jonty.rh...@gmail.com] > Gesendet: Donnerstag, 29. Juli 2010 08:20 > An: solr-user@lucene.apache.org > Betreff: Re: logic required for newbie > > Again thanks for reply.. > > Actually I am getting result. But I am getting all column of the rows. I > want to remove unnecessary column. > In case of q=piza hut.. then I want to get only <landmark4>piza > hut</landmark4>. > Same if search query change to "ford motor" then want only <landmark5>ford > motor</landmark5>. > more example if query is "piza hut ford motor" then expected result should > be.. > > <id>1</id> > <name>some name</name> > <user_id>user_id</user_id> > <location>new york</location> > <country>USA</country> > <landmark4>piza hut</landmark4> > <landmark5>ford motor</landmark5> > > In above expected result.. <landmark1>5th avenue</landmark1>, > <landmark2>ms departmental store</landmark2>, <landmark3>base > bakery</landmark3> , > > has been removed because it not carrying any matched text.. > > More generalized form I want to filter all unmatched column which not > carrying matched query. > Right now I am getting proper result but getting full column set. My > requirement is only match landmark should return.. > So I want to filter the column which carry text (match to query). > > hoping someone will help me to clear my concept.. > > regards > > On Thu, Jul 29, 2010 at 9:41 AM, rajini maski <rajinima...@gmail.com> > wrote: > > > First of all I hope that in schema you have mentioned for fields > > indexed=true and stored=true... > > Next if you have done so... and now just search as q=landmark:piza... > > you will get one result set only.. > > > > Note : There is one constraint about applying analyzers and tokenizers... > > IF > > you apply white space tokenizer...that is , data type=text_ws..... The > > only you will get result set of "piza hut" even when you query for > > piza... If no tokenizer applied..You will not get it... > > I hope this was needed reply..If something else....you can easy > > question..;) > > > > > > On Wed, Jul 28, 2010 at 8:42 PM, Jonty Rhods <jonty.rh...@gmail.com> > > wrote: > > > > > Hi > > > > > > thanks for reply.. > > > Actually requirement is diffrent (sorry if I am unable to clerify > > > in > > first > > > mail). > > > > > > basically follwoing are the fields name in schema as well: > > > > 1. id > > > > 2. name > > > > 3. user_id > > > > 4. location > > > > 5. country > > > > 6. landmark1 > > > > 7. landmark2 > > > > 8. landmark3 > > > > 9. landmark4 > > > > 10. landmark5 > > > > > > which carrying text... > > > for example: > > > > > > <id>1</id> > > > <name>some name</name> > > > <user_id>user_id</user_id> > > > <location>new york</location> > > > <country>USA</country> > > > <landmark1>5th avenue</landmark1> > > > <landmark2>ms departmental store</landmark2> <landmark3>base > > > bakery</landmark3> <landmark4>piza hut</landmark4> <landmark5>ford > > > motor</landmark5> > > > > > > now if user search by "piza" then expected result like: > > > > > > <id>1</id> > > > <name>some name</name> > > > <user_id>user_id</user_id> > > > <location>new york</location> > > > <country>USA</country> > > > <landmark4>piza hut</landmark4> > > > > > > it means I want to ignore all other landmark which not match. By > > > filter > > we > > > can filter the fields but here I dont know the the field name > > > because it depends on text match. > > > > > > is there any other solution.. I am ready to change in schema or in > logic. > > I > > > am using solrj. > > > > > > please help me I stuck here.. > > > > > > with regards > > > > > > > > > On Wed, Jul 28, 2010 at 7:22 PM, rajini maski > > > <rajinima...@gmail.com> > > > wrote: > > > > > > > you can index each of these field separately... > > > > field1-> Id > > > > field2-> name > > > > field3->user_id > > > > field4->country..... > > > > > > > > .... > > > > field7-> landmark > > > > > > > > While quering you can specify "q=Landmark9" This will return you > > > > results.. > > > > And if you want only particular fields in output.. use the "fl" > > parameter > > > > in > > > > query... > > > > > > > > like > > > > > > > > http://localhost:8090/solr/select? > > > > indent=on&q=landmark9&fl=ID,user_id,country,landmark& > > > > > > > > This will give your desired solution.. > > > > > > > > > > > > > > > > > > > > On Wed, Jul 28, 2010 at 12:23 PM, Jonty Rhods > > > > <jonty.rh...@gmail.com> > > > > wrote: > > > > > > > > > Hi All, > > > > > > > > > > I am very new and learning solr. > > > > > > > > > > I have 10 column like following in table > > > > > > > > > > 1. id > > > > > 2. name > > > > > 3. user_id > > > > > 4. location > > > > > 5. country > > > > > 6. landmark1 > > > > > 7. landmark2 > > > > > 8. landmark3 > > > > > 9. landmark4 > > > > > 10. landmark5 > > > > > > > > > > when user search for landmark then I want to return only one > > landmark > > > > > which > > > > > match. Rest of the landmark should ingnored.. > > > > > expected result like following if user search by "landmark2".. > > > > > > > > > > 1. id > > > > > 2. name > > > > > 3. user_id > > > > > 4. location > > > > > 5. country > > > > > 7. landmark2 > > > > > > > > > > or if search by "landmark9" > > > > > > > > > > 1. id > > > > > 2. name > > > > > 3. user_id > > > > > 4. location > > > > > 5. country > > > > > 9. landmark9 > > > > > > > > > > > > > > > please help me to design the schema for this kind of requirement... > > > > > > > > > > thanks > > > > > with regards > > > > > > > > > > > > > > >