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 Rakhi Khatwani <rk...@gmail.com> on 2010/06/03 13:16:42 UTC

Deleted documents appearing in facet fields

Hi,
       I have a schema with id as one of the fields. i index some documents
(by adding and deleting some documents).
when i perform faceting on all documents(q=*:*) with facet.field=id, i even
get those id's for which the document is deleted

for example: (0000025_null,0000026_null are deleted documents)


<lst name="facet_fields">
<lst name="id">
<int name="0000022_4">1</int>
<int name="0000022_5">1</int>
<int name="0000022_6">1</int>
<int name="0000022_7">1</int>
<int name="0000022_8">1</int>
<int name="0000022_9">1</int>
<int name="0000025_1">1</int>
<int name="0000025_null">0</int>
<int name="0000026_1">1</int>
<int name="0000026_null">0</int>
<int name="0000042_1">1</int>
</lst>
</lst>

I was under an impression that facets are performed on the search results.
So i am not able to figure out why this is happening.
Moreover is there any strategy avoiding this [other than optimizing indices
(coz we cant optimize indices frequently) or setting facet.mincount=1 (coz
probably we can have a different requirement where existing documents do not
satisfy an existing query)],

Regards,
Raakhi

Re: Deleted documents appearing in facet fields

Posted by Rakhi Khatwani <rk...@gmail.com>.
Thankyou So Much :)

On Thu, Jun 3, 2010 at 6:47 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> > Hi Ahmet,
> >               but i use
> > solrj to commit documents. and there is no commit
> > method which allows you to mention expungeDeletes.
> >
>
> Alternatively you can do it with SolrQuery.
>
> final SolrQuery query = new SolrQuery();
> query.set("qt", "/update");
> query.set("commit", true);
> query.set("expungeDeletes", true);
> System.out.println(SolrServer.query(query));
>
> You can verify it from /admin/stats.jsp#update  e.g. expungeDeletes : 1
>
>
>
>

Re: Deleted documents appearing in facet fields

Posted by Erik Hatcher <er...@gmail.com>.
Ahmet - this would be a good one to genericize on the SolrJ wiki.

It seems there is a lot of confusion about SolrJ, where users of it  
often don't think they can make requests to Solr like you see URL  
examples of, but of course they can make requests to any request  
handler as you've shown.

	Erik

On Jun 3, 2010, at 9:17 AM, Ahmet Arslan wrote:

>> Hi Ahmet,
>>               but i use
>> solrj to commit documents. and there is no commit
>> method which allows you to mention expungeDeletes.
>>
>
> Alternatively you can do it with SolrQuery.
>
> final SolrQuery query = new SolrQuery();
> query.set("qt", "/update");
> query.set("commit", true);
> query.set("expungeDeletes", true);
> System.out.println(SolrServer.query(query));
>
> You can verify it from /admin/stats.jsp#update  e.g.  
> expungeDeletes : 1
>
>
>


Re: Deleted documents appearing in facet fields

Posted by Ahmet Arslan <io...@yahoo.com>.
> Hi Ahmet,
>               but i use
> solrj to commit documents. and there is no commit
> method which allows you to mention expungeDeletes.
> 

Alternatively you can do it with SolrQuery.

final SolrQuery query = new SolrQuery();
query.set("qt", "/update");
query.set("commit", true);
query.set("expungeDeletes", true);
System.out.println(SolrServer.query(query));

You can verify it from /admin/stats.jsp#update  e.g. expungeDeletes : 1 


      

Re: Deleted documents appearing in facet fields

Posted by Rakhi Khatwani <rk...@gmail.com>.
Hi Ahmet,
              but i use solrj to commit documents. and there is no commit
method which allows you to mention expungeDeletes.


BTW i am using solr 1.4

Regards,
Raakhi

On Thu, Jun 3, 2010 at 5:03 PM, Ahmet Arslan <io...@yahoo.com> wrote:

> > Hi,
> >        I have a schema with id as
> > one of the fields. i index some documents
> > (by adding and deleting some documents).
> > when i perform faceting on all documents(q=*:*) with
> > facet.field=id, i even
> > get those id's for which the document is deleted
> >
> > for example: (0000025_null,0000026_null are deleted
> > documents)
> >
> >
> > <lst name="facet_fields">
> > <lst name="id">
> > <int name="0000022_4">1</int>
> > <int name="0000022_5">1</int>
> > <int name="0000022_6">1</int>
> > <int name="0000022_7">1</int>
> > <int name="0000022_8">1</int>
> > <int name="0000022_9">1</int>
> > <int name="0000025_1">1</int>
> > <int name="0000025_null">0</int>
> > <int name="0000026_1">1</int>
> > <int name="0000026_null">0</int>
> > <int name="0000042_1">1</int>
> > </lst>
> > </lst>
> >
> > I was under an impression that facets are performed on the
> > search results.
> > So i am not able to figure out why this is happening.
> > Moreover is there any strategy avoiding this [other than
> > optimizing indices
> > (coz we cant optimize indices frequently) or setting
> > facet.mincount=1 (coz
> > probably we can have a different requirement where existing
> > documents do not
> > satisfy an existing query)],
>
> May be commit with expungeDeletes?     <commit expungeDeletes="true"/>
>
>
> http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22commit.22_and_.22optimize.22
>
>
>
>

Re: Deleted documents appearing in facet fields

Posted by Ahmet Arslan <io...@yahoo.com>.
> Hi,
>        I have a schema with id as
> one of the fields. i index some documents
> (by adding and deleting some documents).
> when i perform faceting on all documents(q=*:*) with
> facet.field=id, i even
> get those id's for which the document is deleted
> 
> for example: (0000025_null,0000026_null are deleted
> documents)
> 
> 
> <lst name="facet_fields">
> <lst name="id">
> <int name="0000022_4">1</int>
> <int name="0000022_5">1</int>
> <int name="0000022_6">1</int>
> <int name="0000022_7">1</int>
> <int name="0000022_8">1</int>
> <int name="0000022_9">1</int>
> <int name="0000025_1">1</int>
> <int name="0000025_null">0</int>
> <int name="0000026_1">1</int>
> <int name="0000026_null">0</int>
> <int name="0000042_1">1</int>
> </lst>
> </lst>
> 
> I was under an impression that facets are performed on the
> search results.
> So i am not able to figure out why this is happening.
> Moreover is there any strategy avoiding this [other than
> optimizing indices
> (coz we cant optimize indices frequently) or setting
> facet.mincount=1 (coz
> probably we can have a different requirement where existing
> documents do not
> satisfy an existing query)],

May be commit with expungeDeletes?     <commit expungeDeletes="true"/>

http://wiki.apache.org/solr/UpdateXmlMessages#Optional_attributes_for_.22commit.22_and_.22optimize.22