Re: Implementing Solr Suggester for Autocomplete (multiple columns)
I am not sure about the value to use for the option popularity. Is there a method or do you just go with some arbitrary number? On Thursday, September 26, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Great!! I haven't see your message yet, perhaps you could create a PR to that Github repository, son it will be in sync with current versions of Solr. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Jueves, 26 de Septiembre 2013 9:10:49 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) solved. On Thu, Sep 26, 2013 at 1:50 PM, JMill apprentice...@googlemail.com wrote: I managed to get rid of the query error by playing jquery file in the velocity folder and adding line: script type=text/javascript src=#{url_for_solr}/admin/file?file=/velocity/jquery.min.jscontentType=text/javascript/script. That has not solved the issues the console is showing a new error - [13:42:55.181] TypeError: $.browser is undefined @ http://localhost:8983/solr/ac/admin/file?file=/velocity/jquery.autocomplete.jscontentType=text/javascript:90 . Any ideas? On Thu, Sep 26, 2013 at 1:12 PM, JMill apprentice...@googlemail.com wrote: Do you know the directory the #{url_root} in script type=text/javascript src=#{url_root}/js/lib/ jquery-1.7.2.min.js/script points too? and same for #{url_for_solr} script type=text/javascript src=#{url_for_solr}/js/lib/jquery-1.7.2.min.js/script On Wed, Sep 25, 2013 at 7:33 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
Do you know the directory the #{url_root} in script type=text/javascript src=#{url_root}/js/lib/ jquery-1.7.2.min.js/script points too? and same for #{url_for_solr} script type=text/javascript src=#{url_for_solr}/js/lib/jquery-1.7.2.min.js/script On Wed, Sep 25, 2013 at 7:33 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that any incompatibility is present it should pop out on the logs. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 11:10:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 10:57:31 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can check the blog post on www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/. This is really flexible, on the downside it does not use the suggester component su this are like regular queries against a separated core. Greetings! - Mensaje original - De: Erick Erickson erickerick...@gmail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 6:16:51 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I've sometimes seen this handled
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
I managed to get rid of the query error by playing jquery file in the velocity folder and adding line: script type=text/javascript src=#{url_for_solr}/admin/file?file=/velocity/jquery.min.jscontentType=text/javascript/script. That has not solved the issues the console is showing a new error - [13:42:55.181] TypeError: $.browser is undefined @ http://localhost:8983/solr/ac/admin/file?file=/velocity/jquery.autocomplete.jscontentType=text/javascript:90;. Any ideas? On Thu, Sep 26, 2013 at 1:12 PM, JMill apprentice...@googlemail.com wrote: Do you know the directory the #{url_root} in script type=text/javascript src=#{url_root}/js/lib/ jquery-1.7.2.min.js/script points too? and same for #{url_for_solr} script type=text/javascript src=#{url_for_solr}/js/lib/jquery-1.7.2.min.js/script On Wed, Sep 25, 2013 at 7:33 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that any incompatibility is present it should pop out on the logs. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 11:10:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 10:57:31 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
solved. On Thu, Sep 26, 2013 at 1:50 PM, JMill apprentice...@googlemail.com wrote: I managed to get rid of the query error by playing jquery file in the velocity folder and adding line: script type=text/javascript src=#{url_for_solr}/admin/file?file=/velocity/jquery.min.jscontentType=text/javascript/script. That has not solved the issues the console is showing a new error - [13:42:55.181] TypeError: $.browser is undefined @ http://localhost:8983/solr/ac/admin/file?file=/velocity/jquery.autocomplete.jscontentType=text/javascript:90;. Any ideas? On Thu, Sep 26, 2013 at 1:12 PM, JMill apprentice...@googlemail.comwrote: Do you know the directory the #{url_root} in script type=text/javascript src=#{url_root}/js/lib/ jquery-1.7.2.min.js/script points too? and same for #{url_for_solr} script type=text/javascript src=#{url_for_solr}/js/lib/jquery-1.7.2.min.js/script On Wed, Sep 25, 2013 at 7:33 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that any incompatibility is present it should pop out on the logs. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 11:10:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 10:57:31 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
Thanks. On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can check the blog post on www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/. This is really flexible, on the downside it does not use the suggester component su this are like regular queries against a separated core. Greetings! - Mensaje original - De: Erick Erickson erickerick...@gmail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 6:16:51 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I've sometimes seen this handled by clever tokenizing. For Bill Rogers, index (untokenized) something like Bill|Bill Rogers Rogers|Bill Rogers Your suggester then is a simple term lookup (see TermsComponent) which is quite fast. What you _don't_ get is autocorrect. But if you use terms.prefix, you can also control whether it's whole word match or not. To get whole-word in the above, you would set your prefix to Rogers| for instance. Or you may want to leave off the | to see more of an autocomplete-type response. Then, of course, when you display this you need to only display what's after the | (or whatever delimiter you use). One other note, this will be case sensitive, so you probably want to do casing yourself, index things like rogers|Bill Rogers and lowercase what you send in to terms component. Best, Erick On Tue, Sep 24, 2013 at 2:01 PM, JMill apprentice...@googlemail.com wrote: Hi, I'm using Solr's Suggester function to implement an autocomplete feature. I have it setup to check against the username and name fields. Problem is when running a query against the name, the second term, after whitespace (surename) returns 0 results. Works if if query is a partial name starting from the begining e.g. Given the name Bill Rogers, a query for Rogers will return 0 results whereas a query for Bill will return positive (Bill Rogers). As for the username, it's not working at. I am after the following behaviour. Match any partial words in the fields username or name and return the results. If there is match in the field name the return the whole name e.g. given the queries Rogers or Bill return Bill Rogers (not the single word that was a match). schema.xml extract .. field name=username type=text_general indexed=true stored=true / field name=name type=text_general indexed=true stored=true/ field name=autocomplete type=textSpell indexed=true stored=false multiValued=true omitNorms=true omitTermFreqAndPositions=false / ... copyField source=username dest=autocomplete/ copyField source=name dest=autocomplete/ ... fieldType class=solr.TextField name=textSpell positionIncrementGap=100 analyzer tokenizer class=solr.StandardTokenizerFactory/ filter class=solr.StandardFilterFactory/ filter class=solr.LowerCaseFilterFactory/ /analyzer /fieldType solrconfig.xml lst name=spellchecker str name=namesuggest/str str name=classnameorg.apache.solr.spelling.suggest.Suggester/str str name=lookupImplorg.apache.solr.spelling.suggest.tst.TSTLookup/str str name=fieldautocomplete/str !-- the indexed field to derive suggestions from -- float name=threshold0.005/float str name=buildOnCommittrue/str !-- str name=sourceLocationamerican-english/str -- /lst /searchComponent .. requestHandler class=org.apache.solr.handler.component.SearchHandler name=/suggest lst name=defaults str name=spellchecktrue/str str name=spellcheck.dictionarysuggest/str str name=spellcheck.onlyMorePopulartrue/str str name=spellcheck.count5/str str name=spellcheck.collatetrue/str /lst arr name=components strspellcheck/str /arr /requestHandler III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can check the blog post on www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/. This is really flexible, on the downside it does not use the suggester component su this are like regular queries against a separated core. Greetings! - Mensaje original - De: Erick Erickson erickerick...@gmail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 6:16:51 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I've sometimes seen this handled by clever tokenizing. For Bill Rogers, index (untokenized) something like Bill|Bill Rogers Rogers|Bill Rogers Your suggester then is a simple term lookup (see TermsComponent) which is quite fast. What you _don't_ get is autocorrect. But if you use terms.prefix, you can also control whether it's whole word match or not. To get whole-word in the above, you would set your prefix to Rogers| for instance. Or you may want to leave off the | to see more of an autocomplete-type response. Then, of course, when you display this you need to only display what's after the | (or whatever delimiter you use). One other note, this will be case sensitive, so you probably want to do casing yourself, index things like rogers|Bill Rogers and lowercase what you send in to terms component. Best, Erick On Tue, Sep 24, 2013 at 2:01 PM, JMill apprentice...@googlemail.com wrote: Hi, I'm using Solr's Suggester function to implement an autocomplete feature. I have it setup to check against the username and name fields. Problem is when running a query against the name, the second term, after whitespace (surename) returns 0 results. Works if if query is a partial name starting from the begining e.g. Given the name Bill Rogers, a query for Rogers will return 0 results whereas a query for Bill will return positive (Bill Rogers). As for the username, it's not working at. I am after the following behaviour. Match any partial words in the fields username or name and return the results. If there is match in the field name the return the whole name e.g. given the queries Rogers or Bill return Bill Rogers (not the single word that was a match). schema.xml extract .. field name=username type=text_general indexed=true stored=true / field name=name type=text_general indexed=true stored=true/ field name=autocomplete type=textSpell indexed=true stored=false multiValued=true omitNorms=true omitTermFreqAndPositions=false / ... copyField source=username dest=autocomplete/ copyField source=name dest=autocomplete/ ... fieldType class=solr.TextField name=textSpell positionIncrementGap=100 analyzer tokenizer class=solr.StandardTokenizerFactory/ filter class=solr.StandardFilterFactory/ filter class=solr.LowerCaseFilterFactory/ /analyzer /fieldType solrconfig.xml lst name=spellchecker str name=namesuggest/str str name=classnameorg.apache.solr.spelling.suggest.Suggester/str str name=lookupImplorg.apache.solr.spelling.suggest.tst.TSTLookup/str str name=fieldautocomplete/str !-- the indexed field to derive suggestions from -- float name=threshold0.005/float str name=buildOnCommittrue/str !-- str name=sourceLocationamerican-english/str -- /lst /searchComponent .. requestHandler class=org.apache.solr.handler.component.SearchHandler name=/suggest lst name=defaults str name=spellchecktrue/str str name=spellcheck.dictionarysuggest/str str name=spellcheck.onlyMorePopulartrue/str str name=spellcheck.count5/str str name=spellcheck.collatetrue/str /lst arr name=components strspellcheck/str /arr /requestHandler III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 10:57:31 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can check the blog post on www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/. This is really flexible, on the downside it does not use the suggester component su this are like regular queries against a separated core. Greetings! - Mensaje original - De: Erick Erickson erickerick...@gmail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 6:16:51 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I've sometimes seen this handled by clever tokenizing. For Bill Rogers, index (untokenized) something like Bill|Bill Rogers Rogers|Bill Rogers Your suggester then is a simple term lookup (see TermsComponent) which is quite fast. What you _don't_ get is autocorrect. But if you use terms.prefix, you can also control whether it's whole word match or not. To get whole-word in the above, you would set your prefix to Rogers| for instance. Or you may want to leave off the | to see more of an autocomplete-type response. Then, of course, when you display this you need to only display what's after the | (or whatever delimiter you use). One other note, this will be case sensitive, so you probably want to do casing yourself, index things like rogers|Bill Rogers and lowercase what you send in to terms component. Best, Erick On Tue, Sep 24, 2013 at 2:01 PM, JMill apprentice...@googlemail.com wrote: Hi, I'm using Solr's Suggester function to implement an autocomplete feature. I have it setup to check against the username and name fields. Problem is when running a query against the name, the second term, after whitespace (surename) returns 0 results. Works if if query is a partial name starting from the begining e.g. Given the name Bill Rogers, a query for Rogers will return 0 results whereas a query for Bill will return positive (Bill Rogers). As for the username, it's not working at. I am after the following behaviour. Match any partial words in the fields username or name and return the results. If there is match in the field name the return the whole name e.g. given the queries Rogers or Bill return Bill Rogers (not the single word that was a match). schema.xml extract .. field name=username type=text_general indexed=true stored=true / field name=name type=text_general indexed=true stored=true/ field name=autocomplete type=textSpell indexed=true stored=false multiValued=true omitNorms=true omitTermFreqAndPositions=false / ... copyField source=username dest=autocomplete/ copyField source=name dest=autocomplete/ ... fieldType class=solr.TextField name=textSpell positionIncrementGap=100 analyzer tokenizer class=solr.StandardTokenizerFactory/ filter class=solr.StandardFilterFactory/ filter class=solr.LowerCaseFilterFactory/ /analyzer /fieldType solrconfig.xml lst name=spellchecker str name=namesuggest/str str name=classnameorg.apache.solr.spelling.suggest.Suggester/str str name=lookupImplorg.apache.solr.spelling.suggest.tst.TSTLookup/str str name=fieldautocomplete/str !-- the indexed field to derive suggestions from -- float name=threshold0.005/float str name=buildOnCommittrue/str !-- str name=sourceLocationamerican-english/str
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that any incompatibility is present it should pop out on the logs. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 11:10:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 10:57:31 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can check the blog post on www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/. This is really flexible, on the downside it does not use the suggester component su this are like regular queries against a separated core. Greetings! - Mensaje original - De: Erick Erickson erickerick...@gmail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 6:16:51 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I've sometimes seen this handled by clever tokenizing. For Bill Rogers, index (untokenized) something like Bill|Bill Rogers Rogers|Bill Rogers Your suggester then is a simple term lookup (see TermsComponent) which is quite fast. What you _don't_ get is autocorrect. But if you use terms.prefix, you can also control whether it's whole word match or not. To get whole-word in the above, you would set your prefix to Rogers| for instance. Or you may want to leave off the | to see more of an autocomplete-type response. Then, of course, when you display this you need to only display what's after the | (or whatever delimiter you use). One other note, this will be case sensitive, so you probably want to do casing yourself, index things like rogers|Bill Rogers and lowercase what you send in to terms component. Best, Erick On Tue, Sep 24, 2013 at 2:01 PM, JMill
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
That seems to work. I get back an xml containing a bunch of suggestions. Can we agree that it's jquery that's the problem? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that any incompatibility is present it should pop out on the logs. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 11:10:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 10:57:31 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I followed the instructions, I am able to browse to http://localhost:8983/solr/ac/browse?q=cedebugQuery=true; but I am not getting any suggestions (typed in c in Find Textbox). I wonder if loading the example data is the problem? The response I get after executing the script feed-ac.sh (step 3) is the following. user$ ./feed-ac.sh ?xml version=1.0 encoding=UTF-8? response lst name=responseHeaderint name=status0/intint name=QTime2239/int/lst /response Are you able to confirm if this the expected response? On Wed, Sep 25, 2013 at 1:46 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: I've used a separated core for storing suggestions, based on what I see in: https://github.com/cominvent/autocomplete. You can check the blog post on www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/. This is really flexible, on the downside it does not use the suggester component su this are like regular queries against a separated core. Greetings! III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
Not yet but I do see the $ not found in console. On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: As far as I can tell it is. You can check that by seeing the Console logs on your browser (chrome, firefox, etc.). There should be an error saying that the $ function it's not found. In any case I'll try to set up a testing environment here, but I can only use solr 4.1, which I have here. I haven't downloaded/tested the 4.4 version yet. Do you try replacing the line that includes the jquery-1.4.3.min.js with the new one? - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 14:44:53 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) That seems to work. I get back an xml containing a bunch of suggestions. Can we agree that it's jquery that's the problem? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that any incompatibility is present it should pop out on the logs. Regards, - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 11:10:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) I simple query through admin (*:*) confirms the data is exists. The version I'm working with is solr 4.4.0. The autocomplete manual refers to 3.x. I wonder of this is the problem? On Wed, Sep 25, 2013 at 4:01 PM, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: The response does not show any error, can you confirm that the data is in solr? you should be able to see the numDoc stats in the admin UI. Which version of Solr are you using? I believe that the example was tested on Solr 3.x at least at the time I use it.
Re: Implementing Solr Suggester for Autocomplete (multiple columns)
I guess we found the culprit. On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: That's and indication that jQuery can't be loaded, and without jQuery the autocomplete plugin won't work. This plugin is used to show the popup list that show up at the bottom of the input. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 15:40:00 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Not yet but I do see the $ not found in console. On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: As far as I can tell it is. You can check that by seeing the Console logs on your browser (chrome, firefox, etc.). There should be an error saying that the $ function it's not found. In any case I'll try to set up a testing environment here, but I can only use solr 4.1, which I have here. I haven't downloaded/tested the 4.4 version yet. Do you try replacing the line that includes the jquery-1.4.3.min.js with the new one? - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 14:44:53 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) That seems to work. I get back an xml containing a bunch of suggestions. Can we agree that it's jquery that's the problem? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Try quering the core where the data has been imported, something like: http://localhost:8983/solr/suggestions/select?q=uc In the previous URL suggestions is the name I give to the core, so this should change, if you get results, then the problem could be the jquery dependency. I don't remember doing any change, as far as I know that js file is bundled with solr (at leat in 3.x) version perhaps you could change it the correct jquery version on solr 4.4, if you go into the admin panel (in solr 3.6): http://localhost:8983/solr/admin/schema.jsp And inspect the loaded code, the required file (jquery-1.4.2.min.js) gets loaded in solr 4.4 it should load a similar file, but perhaps a more recent version. Perhaps you could change that part to something like: script type=text/javascript src=#{url_root}/js/lib/jquery-1.7.2.min.js/script Which is used at least on a solr 4.1 that I have laying aroud here somewhere. In any case you can test the suggestions using the URL that I suggest on the top of this mail, in that case you should be able to see the possible results, of course in a less fancy way. - Mensaje original - De: JMill apprentice...@googlemail.com Para: solr-user@lucene.apache.org Enviados: Miércoles, 25 de Septiembre 2013 13:59:32 Asunto: Re: Implementing Solr Suggester for Autocomplete (multiple columns) Could it be the jquery library that is the problem? I opened up solr-home/ac/conf/velocity/head.vm with an editor and I see a reference to the jquery library but I can't seem to find the directory referenced, line: script type=text/javascript src=#{url_for_solr}/admin/jquery-1.4.3.min.js. Do you know where #{url_for_solr} points to? On Wednesday, September 25, 2013, Ing. Jorge Luis Betancourt Gonzalez jlbetanco...@uci.cu wrote: Perhaps this could be an issue, I know that this works perfectly in solr 3.6 (this is the one I was using). Currently I don't have a solr 4.4 to do some tests, but what have been done in that core should work in solr 4.4, perhaps there is a setting that need some tweaking but it's impossible of knowing without checking the logs. In case that III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu III Escuela Internacional de Invierno en la UCI del 17 al 28 de febrero del 2014. Ver www.uci.cu
Implementing Solr Suggester for Autocomplete (multiple columns)
Hi, I'm using Solr's Suggester function to implement an autocomplete feature. I have it setup to check against the username and name fields. Problem is when running a query against the name, the second term, after whitespace (surename) returns 0 results. Works if if query is a partial name starting from the begining e.g. Given the name Bill Rogers, a query for Rogers will return 0 results whereas a query for Bill will return positive (Bill Rogers). As for the username, it's not working at. I am after the following behaviour. Match any partial words in the fields username or name and return the results. If there is match in the field name the return the whole name e.g. given the queries Rogers or Bill return Bill Rogers (not the single word that was a match). schema.xml extract .. field name=username type=text_general indexed=true stored=true / field name=name type=text_general indexed=true stored=true/ field name=autocomplete type=textSpell indexed=true stored=false multiValued=true omitNorms=true omitTermFreqAndPositions=false / ... copyField source=username dest=autocomplete/ copyField source=name dest=autocomplete/ ... fieldType class=solr.TextField name=textSpell positionIncrementGap=100 analyzer tokenizer class=solr.StandardTokenizerFactory/ filter class=solr.StandardFilterFactory/ filter class=solr.LowerCaseFilterFactory/ /analyzer /fieldType solrconfig.xml lst name=spellchecker str name=namesuggest/str str name=classnameorg.apache.solr.spelling.suggest.Suggester/str str name=lookupImplorg.apache.solr.spelling.suggest.tst.TSTLookup/str str name=fieldautocomplete/str !-- the indexed field to derive suggestions from -- float name=threshold0.005/float str name=buildOnCommittrue/str !-- str name=sourceLocationamerican-english/str -- /lst /searchComponent .. requestHandler class=org.apache.solr.handler.component.SearchHandler name=/suggest lst name=defaults str name=spellchecktrue/str str name=spellcheck.dictionarysuggest/str str name=spellcheck.onlyMorePopulartrue/str str name=spellcheck.count5/str str name=spellcheck.collatetrue/str /lst arr name=components strspellcheck/str /arr /requestHandler
Re: Cause of NullPointer Exception? (Solr with Spring Data)
I am able to reach http://localhost:8983/solr/#/ Here is the Log Content. It not much. Time Level Logger Message 12:38:47 WARN SolrCore [collection1] Solr index directory '/usr/local/Cellar/solr/4.4.0/libexec/example/solr/collection1/data/index' doesn't exist. Creating new index.. On Sat, Sep 21, 2013 at 12:57 PM, Furkan KAMACI furkankam...@gmail.comwrote: Your solr server may not bet working correctly. You should give us information about your solr logs instead of Spring. Can you reach Solr admin page? 20 Eylül 2013 Cuma tarihinde JMill apprentice...@googlemail.com adlı kullanıcı şöyle yazdı: I am unsure about the cause of the following NullPointer Exception. Any Ideas? Thanks Exception in thread main org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aDocumentService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.project.core.solr.repository.DocumentRepository com.project.core.solr.service.impl.DocumentServiceImpl.DocRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.context.annotation.AnnotationConfigApplicationContext.init(AnnotationConfigApplicationContext.java:73) at com.project.core.solr..DocumentTester.main(DocumentTester.java:18) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.project.core.solr.repository.DocumentRepository com.project.core.solr.service.impl.DocumentServiceImpl.DocRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285) ... 12 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates
Problem running EmbeddedSolr (spring data)
What is the cause of this Stactrace? Working with the following solr maven dependancies solr-core-version4.4.0/ solr-core-version spring-data-solr-version1.0.0.RC1/spring-data-solr-version Stacktrace SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'solrServerFactoryBean' defined in class path resource [com/project/core/config/EmbeddedSolrContext.class]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.solr.core.CoreContainer.init(Ljava/lang/String;Ljava/io/File;)V at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.NoSuchMethodError: org.apache.solr.core.CoreContainer.init(Ljava/lang/String;Ljava/io/File;)V at org.springframework.data.solr.server.support.EmbeddedSolrServerFactory.createPathConfiguredSolrServer(EmbeddedSolrServerFactory.java:96) at org.springframework.data.solr.server.support.EmbeddedSolrServerFactory.initSolrServer(EmbeddedSolrServerFactory.java:72) at org.springframework.data.solr.server.support.EmbeddedSolrServerFactoryBean.afterPropertiesSet(EmbeddedSolrServerFactoryBean.java:41) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) ... 22 more //Config Class @Configuration @EnableSolrRepositories(core.solr.repository) @Profile(dev) @PropertySource(classpath:solr.properties) public class EmbeddedSolrContext { @Resource private Environment environment; @Bean public EmbeddedSolrServerFactoryBean solrServerFactoryBean() { EmbeddedSolrServerFactoryBean factory = new EmbeddedSolrServerFactoryBean(); factory.setSolrHome(environment.getRequiredProperty(solr.solr.home)); return factory; } @Bean public SolrTemplate solrTemplate() throws Exception { return new SolrTemplate(solrServerFactoryBean().getObject()); } } Solr.properties solr.server.url=http://localhost:8983/solr/ solr.solr.home=classpath*:com/project/core/solr -- NOTE: points to an empty package inside the project
Cause of NullPointer Exception? (Solr with Spring Data)
I am unsure about the cause of the following NullPointer Exception. Any Ideas? Thanks Exception in thread main org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aDocumentService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.project.core.solr.repository.DocumentRepository com.project.core.solr.service.impl.DocumentServiceImpl.DocRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1116) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.context.annotation.AnnotationConfigApplicationContext.init(AnnotationConfigApplicationContext.java:73) at com.project.core.solr..DocumentTester.main(DocumentTester.java:18) Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.project.core.solr.repository.DocumentRepository com.project.core.solr.service.impl.DocumentServiceImpl.DocRepo; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285) ... 12 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1454) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:910) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:853) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486) ... 14 more Caused by: java.lang.NullPointerException at org.springframework.data.solr.repository.support.MappingSolrEntityInformation.getIdAttribute(MappingSolrEntityInformation.java:68) at org.springframework.data.solr.repository.support.SimpleSolrRepository.init(SimpleSolrRepository.java:73) at