Solr's Index Live Updates

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Solr's Index Live Updates

Gonzalo Payo Navarro
Hi everyone!

I've a question: Is there a way to update a document in Solr (v. 1.4)
and that document is ready for searches without a reindex?

Let me put it this way: My index is filled with documents like, say,
DOC_ID, STATUS and TEXT fields. What if I want to update the TEXT
field and see that change immediately in the Solr's Index.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Solr's Index Live Updates

Jan Høydahl / Cominvent
Hi,

I'm afraid you'll have to post the full document again, then do a commit.
But it WILL be lightning fast, as it is only the updated document which is indexed, all the other existing documents will not be re-indexed.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Training in Europe - www.solrtraining.com

On 18. aug. 2010, at 15.44, Gonzalo Payo Navarro wrote:

> Hi everyone!
>
> I've a question: Is there a way to update a document in Solr (v. 1.4)
> and that document is ready for searches without a reindex?
>
> Let me put it this way: My index is filled with documents like, say,
> DOC_ID, STATUS and TEXT fields. What if I want to update the TEXT
> field and see that change immediately in the Solr's Index.
>
> Thanks

Reply | Threaded
Open this post in threaded view
|

multiple values

Ma, Xiaohui (NIH/NLM/LHC) [C]
Hello,

I only can display one author which is last one. It looks like overwrite others.

In xml, I have more than one <author>name</author> in <authorlist></authorlist>.

In data_config.xml, I put the <field column="Author" xpath="/PublishedArticles/Article/AuthorList/Author" />.

In schema.xml, I put <field name="Author" type="text" indexed="true" stored="true" multiValued="true"/>.

Please let me know if I did something wrong, or how I can display it in jsp.

I really appreciate your help!
Reply | Threaded
Open this post in threaded view
|

Re: multiple values

Erick Erickson
The first thing I'd do is look at the document in the admin pages and
determine what you
actually have in the index. If that's OK, have you dumped your responses to
see if the
returned document has multiple entries but you're parsing is off?

Best
Erick

On Wed, Aug 18, 2010 at 5:00 PM, Ma, Xiaohui (NIH/NLM/LHC) [C] <
[hidden email]> wrote:

> Hello,
>
> I only can display one author which is last one. It looks like overwrite
> others.
>
> In xml, I have more than one <author>name</author> in
> <authorlist></authorlist>.
>
> In data_config.xml, I put the <field column="Author"
> xpath="/PublishedArticles/Article/AuthorList/Author" />.
>
> In schema.xml, I put <field name="Author" type="text" indexed="true"
> stored="true" multiValued="true"/>.
>
> Please let me know if I did something wrong, or how I can display it in
> jsp.
>
> I really appreciate your help!
>
Reply | Threaded
Open this post in threaded view
|

Re: multiple values

Lance Norskog-2
The most basic test is a direct search against Solr and look at the
XML output for the values:
http://localhost:8983/solr/select?q=*:*

Perhaps an xpath without the 'Author' element
/PublishedArticles/Article/AuthorList will give Authors as a
multivalued field.

It is also possible that the DIH creates a separate document for each
<Author>, but they all have the same unique id and only the last
document gets saved. Getting multiValued data out of the DIH is
tricky.

Lance

On Thu, Aug 19, 2010 at 1:36 PM, Erick Erickson <[hidden email]> wrote:

> The first thing I'd do is look at the document in the admin pages and
> determine what you
> actually have in the index. If that's OK, have you dumped your responses to
> see if the
> returned document has multiple entries but you're parsing is off?
>
> Best
> Erick
>
> On Wed, Aug 18, 2010 at 5:00 PM, Ma, Xiaohui (NIH/NLM/LHC) [C] <
> [hidden email]> wrote:
>
>> Hello,
>>
>> I only can display one author which is last one. It looks like overwrite
>> others.
>>
>> In xml, I have more than one <author>name</author> in
>> <authorlist></authorlist>.
>>
>> In data_config.xml, I put the <field column="Author"
>> xpath="/PublishedArticles/Article/AuthorList/Author" />.
>>
>> In schema.xml, I put <field name="Author" type="text" indexed="true"
>> stored="true" multiValued="true"/>.
>>
>> Please let me know if I did something wrong, or how I can display it in
>> jsp.
>>
>> I really appreciate your help!
>>
>



--
Lance Norskog
[hidden email]
Reply | Threaded
Open this post in threaded view
|

multiple values

Brad Dewar
In reply to this post by Ma, Xiaohui (NIH/NLM/LHC) [C]
Hi

In a multiValued field, I want to write a query that returns all the documents that actually have more than 1 value in that field.  (don't care what the value is).

Maybe this should be obvious, but I just can't think of how to formulate such a query.

Any help?

Thanks,
Brad


Reply | Threaded
Open this post in threaded view
|

Re: multiple values

Erik Hatcher-4
My recommendation is if you need to query on something, index it as  
you need... so in this case index another field with the number of  
values in that field.  This is easy if you're writing a custom  
indexer, but maybe not so trivial if you're indexing other ways - so a  
custom update processor could do this for you automatically.

        Erik

On Aug 27, 2010, at 8:19 AM, Brad Dewar wrote:

> Hi
>
> In a multiValued field, I want to write a query that returns all the  
> documents that actually have more than 1 value in that field.  
> (don't care what the value is).
>
> Maybe this should be obvious, but I just can't think of how to  
> formulate such a query.
>
> Any help?
>
> Thanks,
> Brad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: multiple values

Lance Norskog-2
Would "number of values" be an interesting value source/function? Is
it easy to do with a Lucene query?

On Fri, Aug 27, 2010 at 5:25 AM, Erik Hatcher <[hidden email]> wrote:

> My recommendation is if you need to query on something, index it as you
> need... so in this case index another field with the number of values in
> that field.  This is easy if you're writing a custom indexer, but maybe not
> so trivial if you're indexing other ways - so a custom update processor
> could do this for you automatically.
>
>        Erik
>
> On Aug 27, 2010, at 8:19 AM, Brad Dewar wrote:
>
>> Hi
>>
>> In a multiValued field, I want to write a query that returns all the
>> documents that actually have more than 1 value in that field.  (don't care
>> what the value is).
>>
>> Maybe this should be obvious, but I just can't think of how to formulate
>> such a query.
>>
>> Any help?
>>
>> Thanks,
>> Brad
>>
>>
>
>



--
Lance Norskog
[hidden email]