Re: problem executing a query using lucene directly

2016-12-23 Thread Roxana Danger
That's great!! I will test it and let you know.
Roxana


On 22 December 2016 at 21:58, Alan Woodward  wrote:

> Solr wraps its IndexReader in an UninvertingReader, which builds
> doc-values structures in memory if required.  If you include the solr jar
> file on your classpath, you should be able to use UninvertingReader.wrap()
> to do something similar.
>
> Alan Woodward
> www.flax.co.uk
>
>
> > On 22 Dec 2016, at 17:58, Roxana Danger 
> wrote:
> >
> > Hi Alan,
> > thank you very much, but I am not sure if this is the reason.
> >
> > but if I use the solrSearcher, FieldValueQuery works well, using the same
> > index.
> > If SolrIndexSearcher enable this feature, how does it do it?
> >
> > Thank you again!
> >
> >
> >
> >
> > On 22 December 2016 at 17:34, Alan Woodward  wrote:
> >
> >> Hi,
> >>
> >> FieldValueQuery reports matches using docvalues, and it looks like
> they’re
> >> not enabled on that field.
> >>
> >> Alan Woodward
> >> www.flax.co.uk
> >>
> >>
> >>> On 22 Dec 2016, at 16:21, Roxana Danger  uk>
> >> wrote:
> >>>
> >>> Hi all,
> >>>
> >>> I have created an index using solr. I am trying to execute the
> following
> >>> code, but I get zero results in the count.
> >>>
> >>> DirectoryReader dr = DirectoryReader.open(FSDirectory.open(new
> >>> File(indexDir).toPath()));
> >>> IndexSearcher searcher = new IndexSearcher( dr );
> >>>
> >>> System.out.println(dr.maxDoc()); // Shows 200
> >>> Query query = new FieldValueQuery("table");
> >>> CollectionStatistics stats = searcher.collectionStatistics("table");
> >>> System.out.println(stats.docCount()); // Shows 200
> >>>
> >>> System.out.println(searcher.count(query)); //Shows 0, should be
> 200
> >>>
> >>> The definition of the table filed in the schema.xml is:
> >>>
> >>>  >>> required="true" multiValued="false"/>
> >>>
> >>>
> >>> Any idea, why this could be happening? Why the search with the
> >>> FieldValueQuery is not returning the correct result?
> >>>
> >>> Thank you very much in advance.
> >>>
> >>> --
> >>> Reed Online Ltd is a company registered in England and Wales. Company
> >>> Registration Number: 6317279.
> >>> Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.
> >>
> >>
> >
> >
> > --
> > Roxana Danger | Senior Data Scientist
> > Dragon Court, 27-29 Macklin Street, London, WC2B 5LX
> > Tel: 020 7067 4568   Ext:
> > [image: reed.co.uk] 
> > The UK's #1 job site. 
> > [image: Follow us on Twitter] 
> >  [image: Like us on
> Facebook]
> > 
> > 
> > It's time to Love Mondays » 
> >
> > --
> > Reed Online Ltd is a company registered in England and Wales. Company
> > Registration Number: 6317279.
> > Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.
>

-- 
Reed Online Ltd is a company registered in England and Wales. Company 
Registration Number: 6317279.
Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.


Re: problem executing a query using lucene directly

2016-12-22 Thread Alan Woodward
Solr wraps its IndexReader in an UninvertingReader, which builds doc-values 
structures in memory if required.  If you include the solr jar file on your 
classpath, you should be able to use UninvertingReader.wrap() to do something 
similar.

Alan Woodward
www.flax.co.uk


> On 22 Dec 2016, at 17:58, Roxana Danger  
> wrote:
> 
> Hi Alan,
> thank you very much, but I am not sure if this is the reason.
> 
> but if I use the solrSearcher, FieldValueQuery works well, using the same
> index.
> If SolrIndexSearcher enable this feature, how does it do it?
> 
> Thank you again!
> 
> 
> 
> 
> On 22 December 2016 at 17:34, Alan Woodward  wrote:
> 
>> Hi,
>> 
>> FieldValueQuery reports matches using docvalues, and it looks like they’re
>> not enabled on that field.
>> 
>> Alan Woodward
>> www.flax.co.uk
>> 
>> 
>>> On 22 Dec 2016, at 16:21, Roxana Danger 
>> wrote:
>>> 
>>> Hi all,
>>> 
>>> I have created an index using solr. I am trying to execute the following
>>> code, but I get zero results in the count.
>>> 
>>> DirectoryReader dr = DirectoryReader.open(FSDirectory.open(new
>>> File(indexDir).toPath()));
>>> IndexSearcher searcher = new IndexSearcher( dr );
>>> 
>>> System.out.println(dr.maxDoc()); // Shows 200
>>> Query query = new FieldValueQuery("table");
>>> CollectionStatistics stats = searcher.collectionStatistics("table");
>>> System.out.println(stats.docCount()); // Shows 200
>>> 
>>> System.out.println(searcher.count(query)); //Shows 0, should be 200
>>> 
>>> The definition of the table filed in the schema.xml is:
>>> 
>>> >> required="true" multiValued="false"/>
>>> 
>>> 
>>> Any idea, why this could be happening? Why the search with the
>>> FieldValueQuery is not returning the correct result?
>>> 
>>> Thank you very much in advance.
>>> 
>>> --
>>> Reed Online Ltd is a company registered in England and Wales. Company
>>> Registration Number: 6317279.
>>> Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.
>> 
>> 
> 
> 
> -- 
> Roxana Danger | Senior Data Scientist
> Dragon Court, 27-29 Macklin Street, London, WC2B 5LX
> Tel: 020 7067 4568   Ext:
> [image: reed.co.uk] 
> The UK's #1 job site. 
> [image: Follow us on Twitter] 
>  [image: Like us on Facebook]
> 
> 
> It's time to Love Mondays » 
> 
> -- 
> Reed Online Ltd is a company registered in England and Wales. Company 
> Registration Number: 6317279.
> Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.



Re: problem executing a query using lucene directly

2016-12-22 Thread Roxana Danger
Hi Alan,
thank you very much, but I am not sure if this is the reason.

but if I use the solrSearcher, FieldValueQuery works well, using the same
index.
If SolrIndexSearcher enable this feature, how does it do it?

Thank you again!




On 22 December 2016 at 17:34, Alan Woodward  wrote:

> Hi,
>
> FieldValueQuery reports matches using docvalues, and it looks like they’re
> not enabled on that field.
>
> Alan Woodward
> www.flax.co.uk
>
>
> > On 22 Dec 2016, at 16:21, Roxana Danger 
> wrote:
> >
> > Hi all,
> >
> > I have created an index using solr. I am trying to execute the following
> > code, but I get zero results in the count.
> >
> > DirectoryReader dr = DirectoryReader.open(FSDirectory.open(new
> > File(indexDir).toPath()));
> > IndexSearcher searcher = new IndexSearcher( dr );
> >
> > System.out.println(dr.maxDoc()); // Shows 200
> > Query query = new FieldValueQuery("table");
> > CollectionStatistics stats = searcher.collectionStatistics("table");
> > System.out.println(stats.docCount()); // Shows 200
> >
> > System.out.println(searcher.count(query)); //Shows 0, should be 200
> >
> > The definition of the table filed in the schema.xml is:
> >
> >  > required="true" multiValued="false"/>
> >
> >
> > Any idea, why this could be happening? Why the search with the
> > FieldValueQuery is not returning the correct result?
> >
> > Thank you very much in advance.
> >
> > --
> > Reed Online Ltd is a company registered in England and Wales. Company
> > Registration Number: 6317279.
> > Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.
>
>


-- 
Roxana Danger | Senior Data Scientist
Dragon Court, 27-29 Macklin Street, London, WC2B 5LX
Tel: 020 7067 4568   Ext:
[image: reed.co.uk] 
The UK's #1 job site. 
[image: Follow us on Twitter] 
 [image: Like us on Facebook]


It's time to Love Mondays » 

-- 
Reed Online Ltd is a company registered in England and Wales. Company 
Registration Number: 6317279.
Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.


Re: problem executing a query using lucene directly

2016-12-22 Thread Alan Woodward
Hi, 

FieldValueQuery reports matches using docvalues, and it looks like they’re not 
enabled on that field.

Alan Woodward
www.flax.co.uk


> On 22 Dec 2016, at 16:21, Roxana Danger  
> wrote:
> 
> Hi all,
> 
> I have created an index using solr. I am trying to execute the following
> code, but I get zero results in the count.
> 
> DirectoryReader dr = DirectoryReader.open(FSDirectory.open(new
> File(indexDir).toPath()));
> IndexSearcher searcher = new IndexSearcher( dr );
> 
> System.out.println(dr.maxDoc()); // Shows 200
> Query query = new FieldValueQuery("table");
> CollectionStatistics stats = searcher.collectionStatistics("table");
> System.out.println(stats.docCount()); // Shows 200
> 
> System.out.println(searcher.count(query)); //Shows 0, should be 200
> 
> The definition of the table filed in the schema.xml is:
> 
>  required="true" multiValued="false"/>
> 
> 
> Any idea, why this could be happening? Why the search with the
> FieldValueQuery is not returning the correct result?
> 
> Thank you very much in advance.
> 
> -- 
> Reed Online Ltd is a company registered in England and Wales. Company 
> Registration Number: 6317279.
> Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.



Re: problem executing a query using lucene directly

2016-12-22 Thread Shawn Heisey
On 12/22/2016 9:21 AM, Roxana Danger wrote:
> I have created an index using solr. I am trying to execute the following
> code, but I get zero results in the count.
>
> DirectoryReader dr = DirectoryReader.open(FSDirectory.open(new
> File(indexDir).toPath()));
> IndexSearcher searcher = new IndexSearcher( dr );
>
> System.out.println(dr.maxDoc()); // Shows 200
> Query query = new FieldValueQuery("table");
> CollectionStatistics stats = searcher.collectionStatistics("table");
> System.out.println(stats.docCount()); // Shows 200
>
> System.out.println(searcher.count(query)); //Shows 0, should be 200
>
> The definition of the table filed in the schema.xml is:
>
>  required="true" multiValued="false"/>
>
>
> Any idea, why this could be happening? Why the search with the
> FieldValueQuery is not returning the correct result?

You're writing Lucene code here.  A large part of Solr's purpose is to
avoid the need for Lucene code, so only a fraction of the people on this
list know how to write and troubleshoot Lucene code.  I am not one of them.

You may have better luck with the java-u...@lucene.apache.org mailing
list.  Your question is off-topic for this list.

http://lucene.apache.org/core/discussion.html

Thanks,
Shawn



problem executing a query using lucene directly

2016-12-22 Thread Roxana Danger
Hi all,

I have created an index using solr. I am trying to execute the following
code, but I get zero results in the count.

DirectoryReader dr = DirectoryReader.open(FSDirectory.open(new
File(indexDir).toPath()));
IndexSearcher searcher = new IndexSearcher( dr );

System.out.println(dr.maxDoc()); // Shows 200
Query query = new FieldValueQuery("table");
CollectionStatistics stats = searcher.collectionStatistics("table");
System.out.println(stats.docCount()); // Shows 200

System.out.println(searcher.count(query)); //Shows 0, should be 200

The definition of the table filed in the schema.xml is:




Any idea, why this could be happening? Why the search with the
FieldValueQuery is not returning the correct result?

Thank you very much in advance.

-- 
Reed Online Ltd is a company registered in England and Wales. Company 
Registration Number: 6317279.
Registered Office: Academy Court, 94 Chancery Lane, London WC2A 1DT.