Suggester
Hello together, I have some problems with the Solr 5.1.0 suggester. I followed the instructions in https://cwiki.apache.org/confluence/display/solr/Suggester and also tried the techproducts example delivered with the binary package, which is working well. I added a field suggestions-Field to the schema: The field type definition for „text_suggest“ is pretty simple: I Also changed the solrconfig.xml to use the suggestions field: mySuggester FuzzyLookupFactory DocumentDictionaryFactory suggestions text_general false For Tokens original coming from „title" or „author“, I get suggestions, but not any from the content field. So, what do I have to do? Any help is appreciated. Martin
Re: Suggester
Unfortunately, setting suggestAnalyzerFieldType to "text_suggest" didn’t change anything. The suggest dictionary is freshly built. As I mentioned before, only words or phrases of the source field „content“ are not matched. When querying the index, the response only contains „suggestions“ field data not coming from the „content“ field. The complete schema is a slightly modified techproducts schema. „Normal“ searching for words which I would expect coming from „content“ works. Any more ideas? Thanks Martin > Am 21.04.2015 um 17:39 schrieb Erick Erickson : > > Did you build your suggest dictionary after indexing? Kind of a shot in the > dark but worth a try. > > Note that the suggest field of your suggester isn't using your "text_suggest" > field type to make suggestions, it's using "text_general". IOW, the text may > not be analyzed as you expect. > > Best, > Erick > > On Tue, Apr 21, 2015 at 7:16 AM, Martin Keller > wrote: >> Hello together, >> >> I have some problems with the Solr 5.1.0 suggester. >> I followed the instructions in >> https://cwiki.apache.org/confluence/display/solr/Suggester and also tried >> the techproducts example delivered with the binary package, which is working >> well. >> >> I added a field suggestions-Field to the schema: >> >> > multiValued="true“/> >> >> >> And added some copies to the field: >> >> >> >> >> >> >> >> >> The field type definition for „text_suggest“ is pretty simple: >> >> > positionIncrementGap="100"> >> >> >>> words="stopwords.txt" /> >> >> >> >> >> >> I Also changed the solrconfig.xml to use the suggestions field: >> >> >> >>mySuggester >>FuzzyLookupFactory >>DocumentDictionaryFactory >>suggestions >>text_general >>false >> >> >> >> >> For Tokens original coming from „title" or „author“, I get suggestions, but >> not any from the content field. >> So, what do I have to do? >> >> Any help is appreciated. >> >> >> Martin >>
Re: Suggester
OK, I found the problem and as so often it was sitting in front of the display. Now the next problem: The suggestions returned consist always of a complete text block where the match was found. I would have expected a single word or a small phrase. Thanks in advance Martin > Am 22.04.2015 um 12:50 schrieb Martin Keller : > > Unfortunately, setting suggestAnalyzerFieldType to "text_suggest" didn’t > change anything. > The suggest dictionary is freshly built. > As I mentioned before, only words or phrases of the source field „content“ > are not matched. > When querying the index, the response only contains „suggestions“ field data > not coming from the „content“ field. > The complete schema is a slightly modified techproducts schema. > „Normal“ searching for words which I would expect coming from „content“ works. > > Any more ideas? > > Thanks > Martin > > >> Am 21.04.2015 um 17:39 schrieb Erick Erickson : >> >> Did you build your suggest dictionary after indexing? Kind of a shot in the >> dark but worth a try. >> >> Note that the suggest field of your suggester isn't using your "text_suggest" >> field type to make suggestions, it's using "text_general". IOW, the text may >> not be analyzed as you expect. >> >> Best, >> Erick >> >> On Tue, Apr 21, 2015 at 7:16 AM, Martin Keller >> wrote: >>> Hello together, >>> >>> I have some problems with the Solr 5.1.0 suggester. >>> I followed the instructions in >>> https://cwiki.apache.org/confluence/display/solr/Suggester and also tried >>> the techproducts example delivered with the binary package, which is >>> working well. >>> >>> I added a field suggestions-Field to the schema: >>> >>> >> multiValued="true“/> >>> >>> >>> And added some copies to the field: >>> >>> >>> >>> >>> >>> >>> >>> >>> The field type definition for „text_suggest“ is pretty simple: >>> >>> >> positionIncrementGap="100"> >>> >>> >>> >> words="stopwords.txt" /> >>> >>> >>> >>> >>> >>> I Also changed the solrconfig.xml to use the suggestions field: >>> >>> >>> >>> mySuggester >>> FuzzyLookupFactory >>> DocumentDictionaryFactory >>> suggestions >>> text_general >>> false >>> >>> >>> >>> >>> For Tokens original coming from „title" or „author“, I get suggestions, but >>> not any from the content field. >>> So, what do I have to do? >>> >>> Any help is appreciated. >>> >>> >>> Martin >>> >
Atomic Updates with SolrJ
Hello, I’m trying to Update a field in a document via SolrJ. Unfortunately, while the field itself is updated correctly, values of some other fields are removed. The code looks like this: SolrInputDocument updateDoc = new SolrInputDocument(); updateDoc.addField("id", "1234"); Map updateValue = new HashMap<>(); updateValue.put("set", 1); updateDoc.addField("fieldToUpdate", updateValue); final UpdateRequest request; request = new UpdateRequest(); request.add(updateDoc); request.process(solrClient, "myCollection"); solrClient.commit(); If I send a similar request with curl, e.g. curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/myCollection/update' --data-binary '[{"id":"1234", "fieldToUpdate":{"set":"1"}}]' it works as expected. I’m using Solr 6.0.1, but the problem also occurs in 6.6.0. Any ideas? Thanks Martin
Re: Atomic Updates with SolrJ
Hello, as Amrit mentioned, I attached the schema.xml of such an index. Perhaps there is something to find in it. The responses of update and commit look quite normal: {responseHeader={status=0,QTime=2}} {responseHeader={status=0,QTime=14}} After committing the fields fld_BA1F56CD9C87419CB9A271DC5BA86ED0A899C7FD fld_C5D06670E09EC0014F82A7B3536DAF2CE2BAB3AD do not have content any more and the suggest_freetext is also empty. In my example the commit call has been missing the collection parameter. Sorry for that. Thanks in advance Martin Am 09.11.17, 10:22 schrieb "Amrit Sarkar" : Hi Martin, I tested the same application SolrJ code on my system, it worked just fine on Solr 6.6.x. My Solrclient is "CloudSolrJClient", which I think doesn't make any difference. Can you show the response and field declarations if you are continuously facing the issue. Amrit Sarkar Search Engineer Lucidworks, Inc. 415-589-9269 www.lucidworks.com Twitter http://twitter.com/lucidworks LinkedIn: https://www.linkedin.com/in/sarkaramrit2 Medium: https://medium.com/@sarkaramrit2 On Thu, Nov 9, 2017 at 1:55 PM, Martin Keller < martin.kel...@unitedplanet.com> wrote: > Hello, > > I’m trying to Update a field in a document via SolrJ. Unfortunately, while > the field itself is updated correctly, values of some other fields are > removed. > The code looks like this: > > SolrInputDocument updateDoc = new SolrInputDocument(); > > updateDoc.addField("id", "1234"); > > Map updateValue = new HashMap<>(); > updateValue.put("set", 1); > updateDoc.addField("fieldToUpdate", updateValue); > > final UpdateRequest request; > > request = new UpdateRequest(); > request.add(updateDoc); > > request.process(solrClient, "myCollection"); > solrClient.commit(); > > > If I send a similar request with curl, e.g. > > curl -X POST -H 'Content-Type: application/json' ' > http://localhost:8983/solr/myCollection/update' --data-binary > '[{"id":"1234", "fieldToUpdate":{"set":"1"}}]' > > it works as expected. > I’m using Solr 6.0.1, but the problem also occurs in 6.6.0. > > Any ideas? > > Thanks > Martin > > schema.xml Description: schema.xml