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 twojah <eb...@tokobagus.com> on 2010/08/06 05:51:53 UTC

Query Result is not updated based on the new XML files

hi everyone,
I run the query from the browser:
http://172.16.17.126:8983/search/select/?q=AUC_CAT:978

the query is based on cat_978.xml which was produced by my PHP script
and I got the correct result like this:
<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">4</int>
    <lst name="params">
      <str name="q.op">AND</str>
      <str name="fl">AUC_ID,AUC_CAT,AUC_DESCR_SHORT</str>
      <str name="start">0</str>
      <str name="q">AUC_CAT:978</str>
      <str name="rows">1000</str>
    </lst>
  </lst>
  <result name="response" numFound="1575" start="0">
    <doc>
      <int name="AUC_CAT">978</int>
      <str name="AUC_DESCR_SHORT">HP Compaq Presario V3700Core 2 duo webcam
wifi lan HD 160Gb DDR2 1Gb Tas original windows 7 ultimate</str>
      <int name="AUC_ID">618436123</int>
    </doc>
    <doc>
      <int name="AUC_CAT">978</int>
      <str name="AUC_DESCR_SHORT">HP Compaq Presario V3700Core 2 duo webcam
wifi lan HD 160Gb DDR2 1Gb Tas original windows 7 ultimate</str>
      <int name="AUC_ID">618436</int>
    </doc>
  </result>
</response>

now, I edit the AUC_ID field in cat_978.xml, I change 618436123 to 618436
(look the bold letters above)
and I refresh the browser but it doesn't updated or reflect the changes I
was made
how to make the query result updated exactly based on cat_978.xml changes?

really need your help
thanks before
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Query-Result-is-not-updated-based-on-the-new-XML-files-tp1028575p1028575.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query Result is not updated based on the new XML files

Posted by Andrei Savu <an...@indekspot.com>.
Yes. First of all you should use a Solr PHP client [1] to send the
changes you need.

A better approach is to add hooks to your application that will update
the Solr index as needed. By doing this you improve the efficiency of
the process a lot. It doesn't really make sense to re-index all the
content just for a few changes.

[1] http://code.google.com/p/solr-php-client/

On Fri, Aug 6, 2010 at 7:59 PM, twojah <eb...@tokobagus.com> wrote:
>
> Hi Andrei,
> yes that's what I meant, the query result reflect the changes that I or the
> script made in cat_978.xml which is not happen right now
> I already commit it after the cat_987.xml changed, but the old xml file
> still showed in query result, in other words the ID: 618436123 still there.
>
> I tried these steps and the query resulted correct:
> 1. delete the index (<delete><query>AUC_CAT:978</query></delete>)
> 2. commit the new cat_978.xml (java -jar post.jar cat_978.xml)
> 3. restart the solr (stop and java -jar start.jar)
>
> the problem is how I can send those command from my php script since the
> script is run periodically every half minute via cron?
>
> this the full process of my php script and solr search to make you easier to
> understand:
> php script read the database -> php script create cat_978.xml -> php script
> delete the index -> commit the cat_978.xml -> restart the solr service
>
> those process run every half minute
> is there any simpler process?
>
> thanks in advance
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Query-Result-is-not-updated-based-on-the-new-XML-files-tp1028575p1031009.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Indekspot -- http://www.indekspot.com -- Managed Hosting for Apache Solr

Re: Query Result is not updated based on the new XML files

Posted by twojah <eb...@tokobagus.com>.
Hi Andrei,
yes that's what I meant, the query result reflect the changes that I or the
script made in cat_978.xml which is not happen right now
I already commit it after the cat_987.xml changed, but the old xml file
still showed in query result, in other words the ID: 618436123 still there.

I tried these steps and the query resulted correct:
1. delete the index (<delete><query>AUC_CAT:978</query></delete>)
2. commit the new cat_978.xml (java -jar post.jar cat_978.xml)
3. restart the solr (stop and java -jar start.jar)

the problem is how I can send those command from my php script since the
script is run periodically every half minute via cron?

this the full process of my php script and solr search to make you easier to
understand:
php script read the database -> php script create cat_978.xml -> php script
delete the index -> commit the cat_978.xml -> restart the solr service

those process run every half minute
is there any simpler process?

thanks in advance
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Query-Result-is-not-updated-based-on-the-new-XML-files-tp1028575p1031009.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query Result is not updated based on the new XML files

Posted by Andrei Savu <an...@indekspot.com>.
As I understand you expect that when re-indexing the cat_978.xml file
the document with the ID: 618436123 should disappear. It doesn't work
that way.

You need to do an explicit document delete request. The Solr index
it's not recreated from scratch every time when you post a new .xml
file.

Also remember to commit you changes as Dave suggested.

On Fri, Aug 6, 2010 at 6:51 AM, twojah <eb...@tokobagus.com> wrote:
>
> hi everyone,
> I run the query from the browser:
> http://172.16.17.126:8983/search/select/?q=AUC_CAT:978
>
> the query is based on cat_978.xml which was produced by my PHP script
> and I got the correct result like this:
> <response>
>  <lst name="responseHeader">
>    <int name="status">0</int>
>    <int name="QTime">4</int>
>    <lst name="params">
>      <str name="q.op">AND</str>
>      <str name="fl">AUC_ID,AUC_CAT,AUC_DESCR_SHORT</str>
>      <str name="start">0</str>
>      <str name="q">AUC_CAT:978</str>
>      <str name="rows">1000</str>
>    </lst>
>  </lst>
>  <result name="response" numFound="1575" start="0">
>    <doc>
>      <int name="AUC_CAT">978</int>
>      <str name="AUC_DESCR_SHORT">HP Compaq Presario V3700Core 2 duo webcam
> wifi lan HD 160Gb DDR2 1Gb Tas original windows 7 ultimate</str>
>      <int name="AUC_ID">618436123</int>
>    </doc>
>    <doc>
>      <int name="AUC_CAT">978</int>
>      <str name="AUC_DESCR_SHORT">HP Compaq Presario V3700Core 2 duo webcam
> wifi lan HD 160Gb DDR2 1Gb Tas original windows 7 ultimate</str>
>      <int name="AUC_ID">618436</int>
>    </doc>
>  </result>
> </response>
>
> now, I edit the AUC_ID field in cat_978.xml, I change 618436123 to 618436
> (look the bold letters above)
> and I refresh the browser but it doesn't updated or reflect the changes I
> was made
> how to make the query result updated exactly based on cat_978.xml changes?
>
> really need your help
> thanks before
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Query-Result-is-not-updated-based-on-the-new-XML-files-tp1028575p1028575.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Indekspot -- http://www.indekspot.com -- Managed Hosting for Apache Solr

Re: Query Result is not updated based on the new XML files

Posted by Dave Searle <da...@magicalia.com>.
Did you commit your changes?


On 6 Aug 2010, at 04:52, twojah <eb...@tokobagus.com> wrote:

> 
> hi everyone,
> I run the query from the browser:
> http://172.16.17.126:8983/search/select/?q=AUC_CAT:978
> 
> the query is based on cat_978.xml which was produced by my PHP script
> and I got the correct result like this:
> <response>
>  <lst name="responseHeader">
>    <int name="status">0</int>
>    <int name="QTime">4</int>
>    <lst name="params">
>      <str name="q.op">AND</str>
>      <str name="fl">AUC_ID,AUC_CAT,AUC_DESCR_SHORT</str>
>      <str name="start">0</str>
>      <str name="q">AUC_CAT:978</str>
>      <str name="rows">1000</str>
>    </lst>
>  </lst>
>  <result name="response" numFound="1575" start="0">
>    <doc>
>      <int name="AUC_CAT">978</int>
>      <str name="AUC_DESCR_SHORT">HP Compaq Presario V3700Core 2 duo webcam
> wifi lan HD 160Gb DDR2 1Gb Tas original windows 7 ultimate</str>
>      <int name="AUC_ID">618436123</int>
>    </doc>
>    <doc>
>      <int name="AUC_CAT">978</int>
>      <str name="AUC_DESCR_SHORT">HP Compaq Presario V3700Core 2 duo webcam
> wifi lan HD 160Gb DDR2 1Gb Tas original windows 7 ultimate</str>
>      <int name="AUC_ID">618436</int>
>    </doc>
>  </result>
> </response>
> 
> now, I edit the AUC_ID field in cat_978.xml, I change 618436123 to 618436
> (look the bold letters above)
> and I refresh the browser but it doesn't updated or reflect the changes I
> was made
> how to make the query result updated exactly based on cat_978.xml changes?
> 
> really need your help
> thanks before
> -- 
> View this message in context: http://lucene.472066.n3.nabble.com/Query-Result-is-not-updated-based-on-the-new-XML-files-tp1028575p1028575.html
> Sent from the Solr - User mailing list archive at Nabble.com.