Re: Writing my first Solr Search Component
Thanks, this was very helpful :) -- Regards, Apurv Verma On Thu, Aug 14, 2014 at 9:31 AM, Tri Cao tm...@me.com wrote: 1. No, there is only one instance 2. init() is called 3. check these standard search components: https://github.com/apache/lucene-solr/tree/trunk/solr/core/src/java/org/apache/solr/handler/component Depending on what you are doing, you can pick the component that's closest to your purposes. Otherwise, I'd suggest you look into the most important component of all: QueryComponent.java https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java Also check out the interface: https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchComponent.java Hope this helps, Tri On Aug 13, 2014, at 06:52 PM, Apurv Verma dapu...@gmail.com wrote: Hey all, I am writing my first solr search component and had the following questions. 1. Does each incoming query create a new solr search component object? 2. What happens at the time of core reload? 3. What are some good examples of SearchComponent s written? Thanks -- Regards, Apurv Verma
Writing my first Solr Search Component
Hey all, I am writing my first solr search component and had the following questions. 1. Does each incoming query create a new solr search component object? 2. What happens at the time of core reload? 3. What are some good examples of SearchComponent s written? Thanks -- Regards, Apurv Verma
Re: Writing my first Solr Search Component
1. No, there is only one instance 2. init() is called 3. check these standard search components: https://github.com/apache/lucene-solr/tree/trunk/solr/core/src/java/org/apache/solr/handler/component Depending on what you are doing, you can pick the component that's closest to your purposes. Otherwise, I'd suggest you look into the most important component of all: QueryComponent.java https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java Also check out the interface: https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/handler/component/SearchComponent.java Hope this helps, Tri On Aug 13, 2014, at 06:52 PM, Apurv Verma dapu...@gmail.com wrote: Hey all, I am writing my first solr search component and had the following questions. 1. Does each incoming query create a new solr search component object? 2. What happens at the time of core reload? 3. What are some good examples of SearchComponent s written? Thanks -- Regards, Apurv Verma
how to write my first solr query
Hello, I would like to find all documents that have say foo bar with a filter to remove any cases where foo bar is prefixed with things like cat, a, ... I am ok with a document that has cat foo bar and foo bar, but if it only has cat foo bar then I don't want it while if it has foo bar I want it. I looked at span queries but was not able to come up with how to phrase this. Any pointers would be great! Thank you in advance, Evan -- View this message in context: http://lucene.472066.n3.nabble.com/how-to-write-my-first-solr-query-tp4133509.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: how to write my first solr query
Hi Evan, Confusing use case :) You don't want foo bar is prefixed with cat ? But you are ok with a document that has cat foo bar Isn't this contradiction? On Monday, April 28, 2014 6:26 PM, Evan Smith e...@wingonwing.com wrote: Hello, I would like to find all documents that have say foo bar with a filter to remove any cases where foo bar is prefixed with things like cat, a, ... I am ok with a document that has cat foo bar and foo bar, but if it only has cat foo bar then I don't want it while if it has foo bar I want it. I looked at span queries but was not able to come up with how to phrase this. Any pointers would be great! Thank you in advance, Evan -- View this message in context: http://lucene.472066.n3.nabble.com/how-to-write-my-first-solr-query-tp4133509.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: how to write my first solr query
Hello, Here is a better use case Documents A, B, C, and D A: dear foo bar hello B: dear cat foo bar hello C: dear cat foo bar hello foo bar D: dear car foo bar I have a dictionary of items outside of solr foo bar and cat foo bar And associated with each item is the set of suffix's of that item So I know that foo bar has cat foo bar as a suffix I would like to search my corpus of documents A, B, C and D And just get documents that contain foo bar and not the ones that contain cat foo bar So if I searched on foo bar but not cat foo bar I want to get documents A, C, D But not B which does not have just foo bar but has cat foo bar. I am ok with C as it has a foo bar that is not prefixed with cat. Does this make sense? I see that the (foo bar and not cat foo bar) would not work as it would miss document C. Or at least I think it would. Evan -- View this message in context: http://lucene.472066.n3.nabble.com/how-to-write-my-first-solr-query-tp4133509p4133537.html Sent from the Solr - User mailing list archive at Nabble.com.
RE: how to write my first solr query
Hi Evan, If I understand correctly, a document has to have at least one foo bar without having cat in front. A solution would be to use a combination of the ShingleFilterFactory and query for one occurences of foo bar using the termfreq function. https://cwiki.apache.org/confluence/display/solr/Filter+Descriptions#FilterDescriptions-ShingleFilter https://cwiki.apache.org/confluence/display/solr/Function+Queries The number of shingles depends on how many terms are in the query and how many terms cannot be prefixed. It might be easier to just retrieve all the documents which contain the phrase and process the results outside of Solr. If you could shed some more light on what you are trying to accomplish, maybe we can help you find an even better solution to fit your problem. Jeroen -Original Message- From: Evan Smith [mailto:e...@wingonwing.com] Sent: maandag 28 april 2014 19:20 To: solr-user@lucene.apache.org Subject: Re: how to write my first solr query Hello, Here is a better use case Documents A, B, C, and D A: dear foo bar hello B: dear cat foo bar hello C: dear cat foo bar hello foo bar D: dear car foo bar I have a dictionary of items outside of solr foo bar and cat foo bar And associated with each item is the set of suffix's of that item So I know that foo bar has cat foo bar as a suffix I would like to search my corpus of documents A, B, C and D And just get documents that contain foo bar and not the ones that contain cat foo bar So if I searched on foo bar but not cat foo bar I want to get documents A, C, D But not B which does not have just foo bar but has cat foo bar. I am ok with C as it has a foo bar that is not prefixed with cat. Does this make sense? I see that the (foo bar and not cat foo bar) would not work as it would miss document C. Or at least I think it would. Evan -- View this message in context: http://lucene.472066.n3.nabble.com/how-to-write-my-first-solr-query-tp4133509p4133537.html Sent from the Solr - User mailing list archive at Nabble.com.
RE: how to write my first solr query
Hello, Thank you! I will try out what you suggested and post back once I know more. yes given things like cat foo bar house foo bar foo bar I want to know when the term foo bar (but not the prefix cases I specify) exists in my documents. Thanks! Evan -- View this message in context: http://lucene.472066.n3.nabble.com/how-to-write-my-first-solr-query-tp4133509p4133601.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: AW: My First Solr
Do you see if the document update is sucessful? When you start solr with java -jar start.jar for the example, Solr will list the the document id of the docs that you are adding and tell you how long the update took. A simple but brute force method to findout if a document has been commited is to stop the server and then restart it. You can also use the solr/admin/stats.jsp page to see if the docs are there. After looking at your query in the results you posted, I would bet that you are not specifying a search field. try searching for anwendung:KIS or id:[1 TO *] to see all the docs in you index. Brian Am Freitag, den 13.06.2008, 07:40 +0200 schrieb Thomas Lauer: i have tested: SimplePostTool: version 1.2 SimplePostTool: WARNING: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported SimplePostTool: POSTing files to http://localhost:8983/solr/update.. SimplePostTool: POSTing file import_sample.xml SimplePostTool: COMMITting Solr index changes..
AW: AW: My First Solr
ok, i find my files now. can I make all files to the default search file? Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 08:03 An: solr-user@lucene.apache.org Betreff: Re: AW: My First Solr Do you see if the document update is sucessful? When you start solr with java -jar start.jar for the example, Solr will list the the document id of the docs that you are adding and tell you how long the update took. A simple but brute force method to findout if a document has been commited is to stop the server and then restart it. You can also use the solr/admin/stats.jsp page to see if the docs are there. After looking at your query in the results you posted, I would bet that you are not specifying a search field. try searching for anwendung:KIS or id:[1 TO *] to see all the docs in you index. Brian Am Freitag, den 13.06.2008, 07:40 +0200 schrieb Thomas Lauer: i have tested: SimplePostTool: version 1.2 SimplePostTool: WARNING: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported SimplePostTool: POSTing files to http://localhost:8983/solr/update.. SimplePostTool: POSTing file import_sample.xml SimplePostTool: COMMITting Solr index changes.. __ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3182 (20080612) __ E-Mail wurde geprüft mit ESET NOD32 Antivirus. http://www.eset.com
AW: AW: AW: My First Solr
Hi Brian, i don´t find any documentation or howto for the DisMaxQueryHandler? Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 08:52 An: solr-user@lucene.apache.org Betreff: Re: AW: AW: My First Solr The DisMaxQueryHandler is your friend. Am Freitag, den 13.06.2008, 08:29 +0200 schrieb Thomas Lauer: ok, i find my files now. can I make all files to the default search file? Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 08:03 An: solr-user@lucene.apache.org Betreff: Re: AW: My First Solr Do you see if the document update is sucessful? When you start solr with java -jar start.jar for the example, Solr will list the the document id of the docs that you are adding and tell you how long the update took. A simple but brute force method to findout if a document has been commited is to stop the server and then restart it. You can also use the solr/admin/stats.jsp page to see if the docs are there. After looking at your query in the results you posted, I would bet that you are not specifying a search field. try searching for anwendung:KIS or id:[1 TO *] to see all the docs in you index. Brian Am Freitag, den 13.06.2008, 07:40 +0200 schrieb Thomas Lauer: i have tested: SimplePostTool: version 1.2 SimplePostTool: WARNING: Make sure your XML documents are encoded in UTF-8, other encodings are not currently supported SimplePostTool: POSTing files to http://localhost:8983/solr/update.. SimplePostTool: POSTing file import_sample.xml SimplePostTool: COMMITting Solr index changes.. __ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3182 (20080612) __ E-Mail wurde geprüft mit ESET NOD32 Antivirus. http://www.eset.com __ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3182 (20080612) __ E-Mail wurde geprüft mit ESET NOD32 Antivirus. http://www.eset.com
Re: My First Solr
http://wiki.apache.org/solr/DisMaxRequestHandler In solrconfig.xml there are example configurations for the DisMax. Sorry I told you the wrong name, not enough coffee this morning. Brian. Am Freitag, den 13.06.2008, 09:40 +0200 schrieb Thomas Lauer:
AW: My First Solr
ok, my dismax requestHandler name=dismax class=solr.DisMaxRequestHandler lst name=defaults str name=echoParamsexplicit/str float name=tie0.01/float str name=qf beschreibung^0.5 ordner^1.0 register^1.2 Benutzer^1.5 guid^10.0 mandant^1.1 /str str name=pf beschreibung^0.2 ordner^1.1 register^1.5 manu^1.4 manu_exact^1.9 /str str name=bf ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3 /str str name=fl guid,beschreibung,mandant,Benutzer /str str name=mm 2lt;-1 5lt;-2 6lt;90% /str int name=ps100/int str name=q.alt*:*/str /lst /requestHandler must i make a reindex? I seek with this url http://localhost:8983/solr/select?indent=onversion=2.2q=bonowstart=0rows=10fl=*%2Cscoreqt=dismaxwt=standardexplainOther=hl.fl= The response is: HTTP Status 400 - undefined field text type Status report message undefined field text description The request sent by the client was syntactically incorrect (undefined field text). Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 09:50 An: solr-user@lucene.apache.org Betreff: Re: My First Solr http://wiki.apache.org/solr/DisMaxRequestHandler In solrconfig.xml there are example configurations for the DisMax. Sorry I told you the wrong name, not enough coffee this morning. Brian. Am Freitag, den 13.06.2008, 09:40 +0200 schrieb Thomas Lauer: __ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3182 (20080612) __ E-Mail wurde geprüft mit ESET NOD32 Antivirus. http://www.eset.com
Re: AW: My First Solr
No, you do not have to reindex. You do have to restart the server. The bf has fields listed that are not in your document: popularity, price. delete the bf field, you do not need it unless you want to use boost functions. Brian Am Freitag, den 13.06.2008, 10:36 +0200 schrieb Thomas Lauer: ok, my dismax requestHandler name=dismax class=solr.DisMaxRequestHandler lst name=defaults str name=echoParamsexplicit/str float name=tie0.01/float str name=qf beschreibung^0.5 ordner^1.0 register^1.2 Benutzer^1.5 guid^10.0 mandant^1.1 /str str name=pf beschreibung^0.2 ordner^1.1 register^1.5 manu^1.4 manu_exact^1.9 /str str name=bf ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3 /str str name=fl guid,beschreibung,mandant,Benutzer /str str name=mm 2lt;-1 5lt;-2 6lt;90% /str int name=ps100/int str name=q.alt*:*/str /lst /requestHandler must i make a reindex? I seek with this url http://localhost:8983/solr/select?indent=onversion=2.2q=bonowstart=0rows=10fl=*%2Cscoreqt=dismaxwt=standardexplainOther=hl.fl= The response is: HTTP Status 400 - undefined field text type Status report message undefined field text description The request sent by the client was syntactically incorrect (undefined field text). Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 09:50 An: solr-user@lucene.apache.org Betreff: Re: My First Solr http://wiki.apache.org/solr/DisMaxRequestHandler In solrconfig.xml there are example configurations for the DisMax. Sorry I told you the wrong name, not enough coffee this morning. Brian. Am Freitag, den 13.06.2008, 09:40 +0200 schrieb Thomas Lauer: __ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3182 (20080612) __ E-Mail wurde geprüft mit ESET NOD32 Antivirus. http://www.eset.com
AW: AW: My First Solr
HI Brian thank you for help. Where are you from? Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 11:43 An: solr-user@lucene.apache.org Betreff: Re: AW: My First Solr No, you do not have to reindex. You do have to restart the server. The bf has fields listed that are not in your document: popularity, price. delete the bf field, you do not need it unless you want to use boost functions. Brian Am Freitag, den 13.06.2008, 10:36 +0200 schrieb Thomas Lauer: ok, my dismax requestHandler name=dismax class=solr.DisMaxRequestHandler lst name=defaults str name=echoParamsexplicit/str float name=tie0.01/float str name=qf beschreibung^0.5 ordner^1.0 register^1.2 Benutzer^1.5 guid^10.0 mandant^1.1 /str str name=pf beschreibung^0.2 ordner^1.1 register^1.5 manu^1.4 manu_exact^1.9 /str str name=bf ord(poplarity)^0.5 recip(rord(price),1,1000,1000)^0.3 /str str name=fl guid,beschreibung,mandant,Benutzer /str str name=mm 2lt;-1 5lt;-2 6lt;90% /str int name=ps100/int str name=q.alt*:*/str /lst /requestHandler must i make a reindex? I seek with this url http://localhost:8983/solr/select?indent=onversion=2.2q=bonowstart=0rows=10fl=*%2Cscoreqt=dismaxwt=standardexplainOther=hl.fl= The response is: HTTP Status 400 - undefined field text type Status report message undefined field text description The request sent by the client was syntactically incorrect (undefined field text). Regards Thomas -Ursprüngliche Nachricht- Von: Brian Carmalt [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Juni 2008 09:50 An: solr-user@lucene.apache.org Betreff: Re: My First Solr http://wiki.apache.org/solr/DisMaxRequestHandler In solrconfig.xml there are example configurations for the DisMax. Sorry I told you the wrong name, not enough coffee this morning. Brian. Am Freitag, den 13.06.2008, 09:40 +0200 schrieb Thomas Lauer: __ Hinweis von ESET NOD32 Antivirus, Signaturdatenbank-Version 3182 (20080612) __ E-Mail wurde geprüft mit ESET NOD32 Antivirus. http://www.eset.com
Re: My First Solr
Hi, Thomas! Please, can you give me instructions on how did you installed Solr on Tomcat? Quoting Thomas Lauer : HI, i have installed my first solr on tomcat. I have modify my shema.xml for my XMLacute;s and I have import with the post.jar some xml files. tomcat runs solr/admin runs post.jar imports files but I canacute;t find my files. the reponse ist always 0 0 10 0 on KIS 2.2 My files in the attachment Regards Thomas Ar cieņu, Mihails Links: -- [1] mailto:[EMAIL PROTECTED]
Re: My First Solr
Hi, the string you're looking for is in the anwendung field, while your default searchfield is the beschreibung field, try specifying the searchfield like this anwendung:KIS. Geert Thomas Lauer wrote: HI, i have installed my first solr on tomcat. I have modify my shema.xml for my XML´s and I have import with the post.jar some xml files. tomcat runs solr/admin runs post.jar imports files but I can´t find my files. the reponse ist always ?xml version=1.0 encoding=UTF-8 ? response lst name=responseHeader int name=status0/int int name=QTime0/int lst name=params str name=rows10/str str name=start0/str str name=indenton/str str name=qKIS/str str name=version2.2/str /lst /lst result name=response numFound=0 start=0 / /response My files in the attachment Regards Thomas