Hi,

Yes, this is normal behavior. This is because Solr is *document* based, it does 
not know about *files*.
What happens here is that your source database (or whatever) has had deletinons 
within this category in addition to updates, and you need to relay those to 
Solr.

The best way to integrate with your source system is through some connector 
which picks up deletes as well as adds (updates is just a special case of add). 
If your source data is in a database, have a look at DataImportHandler which 
can be setup to do things like this.

If your source data is on files on a file system only, you'll have to write 
some scripts which takes care of all of this, e.g. by first issuing the delete 
and then the add (tip: try -Dcommit=no on the delete request and -Dcommit=yes 
on the following add to avoid temporary loss of data).

You need to think about what happens if a whole category is deleted. How would 
you know by simply looking at the file system?

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

On 11. aug. 2010, at 04.10, e8en wrote:

> 
> thanks for you response Jan,
> I just knew that the post.jar only an example tool
> so what should I use if not post.jar for production?
> 
> btw, I already tried using this command:
> java -Durl=http://localhost:8983/search/update -jar post.jar cat_817.xml
> 
> and IT WORKS !!
> the cat_817.xml reflected directly in the solr query after I commit the
> cat_817.xml, this is the url:
> http://localhost:8983/search/select/?q=ITEM_CAT:817&version=2.2&start=0&rows=10&indent=on
> 
> the problem is it works if the old xml contain less doc than the new xml,
> for example if the old cat_817.xml contain 2 doc and the new cat_817.xml
> contain 10 doc then I just have to re-index (java
> -Durl=http://localhost:8983/search/update -jar post.jar cat_817.xml) and it
> the query result will have correct result (10 doc), but it doesn't work vice
> versa.
> If the old cat_817.xml contain 10 doc and the new cat_817.xml contain 2 doc,
> then I have to delete the index first (java -Ddata=args -Dcommit=yes -jar
> post.jar "<delete><query>ITEM_CAT:817</query></delete>") and re-index it
> (java -Durl=http://localhost:8983/search/update -jar post.jar cat_817.xml)
> to make the query result updated (2 doc).
> 
> is it a normal process or something wrong with my solr?
> 
> once again thanks again Jan, your help really make my day brighter :)
> and I believe your answer will help many solr newbie especially me
> -- 
> View this message in context: 
> http://lucene.472066.n3.nabble.com/solr-query-result-not-read-the-latest-xml-file-tp1066785p1081802.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to