You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Yoni Amir <Yo...@actimize.com> on 2012/08/30 07:48:17 UTC
solrj api for partial document update
Is there a solrj api for partial document update in solr 4.
It is described here: http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/
That article explains how the xml structure should be. I want to use solrj api, but I can't figure out if it is supported.
Thanks,
Yoni
-----Original Message-----
From: aniljayanti [mailto:anil.jayanti@gmail.com]
Sent: Thursday, August 30, 2012 7:41 AM
To: solr-user@lucene.apache.org
Subject: Re: AW: AW: auto completion search with solr using NGrams in SOLR
Hi,
thanks,
I added "PatternReplaceFilterFactory" like below.Getting results
differently(not like suggester). You suggested to remove
"KeywordTokenizerFactory" , "PatternReplace" is a FilterFactory, then which
"TokenizerFactory" need to use ?
<fieldType name="edgytext" class="solr.TextField"
positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="\s+"
replacement=" " replace="all"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
maxGramSize="15" side="front" />
<filter class="solr.PatternReplaceFilterFactory" pattern="\s+"
replacement=" " replace="all"/>
</analyzer>
</fieldType>
Result :
<?xml version="1.0" encoding="UTF-8" ?>
- <response>
- <lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">2</int>
</lst>
<result name="response" numFound="0" start="0" />
- <lst name="spellcheck">
- <lst name="suggestions">
- <lst name="michael">
<int name="numFound">10</int>
<int name="startOffset">0</int>
<int name="endOffset">7</int>
- <arr name="suggestion">
*<str>michael</str>
<str>michael</str>
<str>michael "</str>
<str>michael j</str>
<str>michael ja</str>
<str>michael jac</str>
<str>michael jack</str>
<str>michael jacks</str>
<str>michael jackso</str>
<str>michael jackson</str>*
</arr>
</lst>
- <lst name="ja">
<int name="numFound">10</int>
<int name="startOffset">8</int>
<int name="endOffset">10</int>
- <arr name="suggestion">
*<str>ja</str>
<str>ja</str>
<str>jag</str>
<str>jam</str>
<str>jami</str>
<str>jamp</str>
<str>jampp</str>
<str>jamppa</str>
<str>jamppa</str>
<str>jamppa t</str>*
</arr>
</lst>
<str name="collation">michael ja</str>
</lst>
</lst>
</response>
Please suggest me if anything missing?
Regards,
AnilJayanti
--
View this message in context: http://lucene.472066.n3.nabble.com/auto-completion-search-with-solr-using-NGrams-in-SOLR-tp3998559p4004231.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: solrj api for partial document update
Posted by Yoni Amir <Yo...@actimize.com>.
In the solrj api, the value of a SolrInputField can be a map, in which case solrj adds an additional attribute to the field's xml element.
For example,
This code:
SolrInputDocument doc = new SolrInputDocument();
Map<String, String> partialUpdate = new HashMap<String, String>();
partialUpdate.put("set", "foo");
doc.addField("id", "test_123");
doc.addField("description", partialUpdate);
yields this document:
<doc boost="1.0">
<field name="id">test_123</field>
<field name="description" update="set">foo</field>
</doc>
In this example I used the value "set" for this additional attribute, but it doesn't work. Solr doesn't update the field as I expected.
According to this link:
http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/
valid values are "set" and "add".
Any idea?
Thanks,
Yoni
-----Original Message-----
From: Yoni Amir [mailto:Yoni.Amir@actimize.com]
Sent: Saturday, September 01, 2012 1:48 PM
To: solr-user@lucene.apache.org
Subject: RE: solrj api for partial document update
Any word on this?
I inspected the solrj code an found nothing. It's a shame if the GA version comes out without such an api.
Thanks again,
Yoni
-----Original Message-----
From: Yoni Amir [mailto:Yoni.Amir@actimize.com]
Sent: Thursday, August 30, 2012 8:48 AM
To: solr-user@lucene.apache.org
Subject: solrj api for partial document update
Is there a solrj api for partial document update in solr 4?
It is described here: http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/
That article explains how the xml structure should be. I want to use solrj api, but I can't figure out if it is supported.
Thanks,
Yoni
RE: solrj api for partial document update
Posted by Yoni Amir <Yo...@actimize.com>.
Any word on this?
I inspected the solrj code an found nothing. It's a shame if the GA version comes out without such an api.
Thanks again,
Yoni
-----Original Message-----
From: Yoni Amir [mailto:Yoni.Amir@actimize.com]
Sent: Thursday, August 30, 2012 8:48 AM
To: solr-user@lucene.apache.org
Subject: solrj api for partial document update
Is there a solrj api for partial document update in solr 4?
It is described here: http://solr.pl/en/2012/07/09/solr-4-0-partial-documents-update/
That article explains how the xml structure should be. I want to use solrj api, but I can't figure out if it is supported.
Thanks,
Yoni
-----Original Message-----
From: aniljayanti [mailto:anil.jayanti@gmail.com]
Sent: Thursday, August 30, 2012 7:41 AM
To: solr-user@lucene.apache.org
Subject: Re: AW: AW: auto completion search with solr using NGrams in SOLR
Hi,
thanks,
I added "PatternReplaceFilterFactory" like below.Getting results differently(not like suggester). You suggested to remove "KeywordTokenizerFactory" , "PatternReplace" is a FilterFactory, then which "TokenizerFactory" need to use ?
<fieldType name="edgytext" class="solr.TextField"
positionIncrementGap="100" omitNorms="true">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
<filter class="solr.PatternReplaceFilterFactory" pattern="\s+"
replacement=" " replace="all"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
maxGramSize="15" side="front" />
<filter class="solr.PatternReplaceFilterFactory" pattern="\s+"
replacement=" " replace="all"/>
</analyzer>
</fieldType>
Result :
<?xml version="1.0" encoding="UTF-8" ?>
- <response>
- <lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">2</int>
</lst>
<result name="response" numFound="0" start="0" />
- <lst name="spellcheck">
- <lst name="suggestions">
- <lst name="michael">
<int name="numFound">10</int>
<int name="startOffset">0</int>
<int name="endOffset">7</int>
- <arr name="suggestion">
*<str>michael</str>
<str>michael</str>
<str>michael "</str>
<str>michael j</str>
<str>michael ja</str>
<str>michael jac</str>
<str>michael jack</str>
<str>michael jacks</str>
<str>michael jackso</str>
<str>michael jackson</str>*
</arr>
</lst>
- <lst name="ja">
<int name="numFound">10</int>
<int name="startOffset">8</int>
<int name="endOffset">10</int>
- <arr name="suggestion">
*<str>ja</str>
<str>ja</str>
<str>jag</str>
<str>jam</str>
<str>jami</str>
<str>jamp</str>
<str>jampp</str>
<str>jamppa</str>
<str>jamppa</str>
<str>jamppa t</str>*
</arr>
</lst>
<str name="collation">michael ja</str>
</lst>
</lst>
</response>
Please suggest me if anything missing?
Regards,
AnilJayanti
--
View this message in context: http://lucene.472066.n3.nabble.com/auto-completion-search-with-solr-using-NGrams-in-SOLR-tp3998559p4004231.html
Sent from the Solr - User mailing list archive at Nabble.com.