You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Matt Hicks <ma...@outr.com> on 2016/11/14 20:39:09 UTC

StartsWith on DrillDown?

I'm trying to add a sub-query to my DrillDownQuery but I keep ending up
with no results when I use add(String dim, Query subQuery).  I'm trying to
query the tags that start with a specific String.

Any suggestions of how to do this would be greatly appreciated. I am using
Lucene Core 6.3.0.

Thank you

Re: StartsWith on DrillDown?

Posted by Matt Hicks <ma...@outr.com>.
I understand this, and that's how I'm using it now, but my situation is
that in my application I want to offer the ability to auto-complete tags
that have results based on the current query.  This is why I'm looking for
a "StartsWith" filter on the tags.  Certainly I could get back all of the
tags and then filter them myself, but eventually there could be hundreds of
thousands of tags that I'm filtering through and if the user starts typing
"but" I want to be able to show "butterfly" if there are tag matches within
the current query.  I'm currently using taxonomy facets.

On Thu, Nov 17, 2016 at 4:23 AM Michael McCandless <
lucene@mikemccandless.com> wrote:

> The idea w/ drill down is you are running a "base query" (what the
> user actually searched for, originally) and then, if the user has
> clicked to drill down on any facet labels, you are also adding
> drill-down queries.
>
> You pass the "base query" to the DrillDownQuery constructor.
>
> And, normally, to add drill-down queries, you would use the add method
> that takes only strings, when the user clicked on a dimension + label.
>
> The add method that takes a custom drill-down query is for more
> advanced use cases, where you are able to create your own query that
> accomplishes the same thing as drilling down by a label; e.g., for
> numeric range facets, you would use this method to pass a numeric
> range filter down.
>
> Have you seen the demo facet examples, e.g.
>
> https://github.com/apache/lucene-solr/blob/master/lucene/demo/src/java/org/apache/lucene/demo/facet/SimpleSortedSetFacetsExample.java
> ?
>
> Are you using SSDV facets or taxonomy facets?
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Wed, Nov 16, 2016 at 5:29 PM, Matt Hicks <ma...@outr.com> wrote:
> > My situation is that I simply don't understand how I'm supposed to pass a
> > `Query` into it.  Just passing in a `new QueryParser(facetName,
> > standardAnalyzer)` to `drillDown.add(facetName, queryParser.parse("valid
> > query"))` just always returns zero items.  I'm guessing it has to do with
> > needing a specific type of query?
> >
> > On Wed, Nov 16, 2016 at 4:05 PM Michael McCandless
> > <lu...@mikemccandless.com> wrote:
> >>
> >> Can you post a test case showing the unexpected behavior?
> >>
> >> Mike McCandless
> >>
> >> http://blog.mikemccandless.com
> >>
> >> On Wed, Nov 16, 2016 at 1:55 PM, Matt Hicks <ma...@outr.com> wrote:
> >> > Is this simply not possible to accomplish or does nobody on this list
> >> > know?
> >> >
> >> > On Mon, Nov 14, 2016 at 2:39 PM Matt Hicks <ma...@outr.com> wrote:
> >> >
> >> >> I'm trying to add a sub-query to my DrillDownQuery but I keep ending
> up
> >> >> with no results when I use add(String dim, Query subQuery).  I'm
> trying
> >> >> to
> >> >> query the tags that start with a specific String.
> >> >>
> >> >> Any suggestions of how to do this would be greatly appreciated. I am
> >> >> using
> >> >> Lucene Core 6.3.0.
> >> >>
> >> >> Thank you
> >> >>
>

Re: StartsWith on DrillDown?

Posted by Michael McCandless <lu...@mikemccandless.com>.
The idea w/ drill down is you are running a "base query" (what the
user actually searched for, originally) and then, if the user has
clicked to drill down on any facet labels, you are also adding
drill-down queries.

You pass the "base query" to the DrillDownQuery constructor.

And, normally, to add drill-down queries, you would use the add method
that takes only strings, when the user clicked on a dimension + label.

The add method that takes a custom drill-down query is for more
advanced use cases, where you are able to create your own query that
accomplishes the same thing as drilling down by a label; e.g., for
numeric range facets, you would use this method to pass a numeric
range filter down.

Have you seen the demo facet examples, e.g.
https://github.com/apache/lucene-solr/blob/master/lucene/demo/src/java/org/apache/lucene/demo/facet/SimpleSortedSetFacetsExample.java
?

Are you using SSDV facets or taxonomy facets?

Mike McCandless

http://blog.mikemccandless.com

On Wed, Nov 16, 2016 at 5:29 PM, Matt Hicks <ma...@outr.com> wrote:
> My situation is that I simply don't understand how I'm supposed to pass a
> `Query` into it.  Just passing in a `new QueryParser(facetName,
> standardAnalyzer)` to `drillDown.add(facetName, queryParser.parse("valid
> query"))` just always returns zero items.  I'm guessing it has to do with
> needing a specific type of query?
>
> On Wed, Nov 16, 2016 at 4:05 PM Michael McCandless
> <lu...@mikemccandless.com> wrote:
>>
>> Can you post a test case showing the unexpected behavior?
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>> On Wed, Nov 16, 2016 at 1:55 PM, Matt Hicks <ma...@outr.com> wrote:
>> > Is this simply not possible to accomplish or does nobody on this list
>> > know?
>> >
>> > On Mon, Nov 14, 2016 at 2:39 PM Matt Hicks <ma...@outr.com> wrote:
>> >
>> >> I'm trying to add a sub-query to my DrillDownQuery but I keep ending up
>> >> with no results when I use add(String dim, Query subQuery).  I'm trying
>> >> to
>> >> query the tags that start with a specific String.
>> >>
>> >> Any suggestions of how to do this would be greatly appreciated. I am
>> >> using
>> >> Lucene Core 6.3.0.
>> >>
>> >> Thank you
>> >>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: StartsWith on DrillDown?

Posted by Matt Hicks <ma...@outr.com>.
My situation is that I simply don't understand how I'm supposed to pass a
`Query` into it.  Just passing in a `new QueryParser(facetName,
standardAnalyzer)` to `drillDown.add(facetName, queryParser.parse("valid
query"))` just always returns zero items.  I'm guessing it has to do with
needing a specific type of query?

On Wed, Nov 16, 2016 at 4:05 PM Michael McCandless <
lucene@mikemccandless.com> wrote:

> Can you post a test case showing the unexpected behavior?
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Wed, Nov 16, 2016 at 1:55 PM, Matt Hicks <ma...@outr.com> wrote:
> > Is this simply not possible to accomplish or does nobody on this list
> know?
> >
> > On Mon, Nov 14, 2016 at 2:39 PM Matt Hicks <ma...@outr.com> wrote:
> >
> >> I'm trying to add a sub-query to my DrillDownQuery but I keep ending up
> >> with no results when I use add(String dim, Query subQuery).  I'm trying
> to
> >> query the tags that start with a specific String.
> >>
> >> Any suggestions of how to do this would be greatly appreciated. I am
> using
> >> Lucene Core 6.3.0.
> >>
> >> Thank you
> >>
>

Re: StartsWith on DrillDown?

Posted by Michael McCandless <lu...@mikemccandless.com>.
Can you post a test case showing the unexpected behavior?

Mike McCandless

http://blog.mikemccandless.com

On Wed, Nov 16, 2016 at 1:55 PM, Matt Hicks <ma...@outr.com> wrote:
> Is this simply not possible to accomplish or does nobody on this list know?
>
> On Mon, Nov 14, 2016 at 2:39 PM Matt Hicks <ma...@outr.com> wrote:
>
>> I'm trying to add a sub-query to my DrillDownQuery but I keep ending up
>> with no results when I use add(String dim, Query subQuery).  I'm trying to
>> query the tags that start with a specific String.
>>
>> Any suggestions of how to do this would be greatly appreciated. I am using
>> Lucene Core 6.3.0.
>>
>> Thank you
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: StartsWith on DrillDown?

Posted by Matt Hicks <ma...@outr.com>.
Is this simply not possible to accomplish or does nobody on this list know?

On Mon, Nov 14, 2016 at 2:39 PM Matt Hicks <ma...@outr.com> wrote:

> I'm trying to add a sub-query to my DrillDownQuery but I keep ending up
> with no results when I use add(String dim, Query subQuery).  I'm trying to
> query the tags that start with a specific String.
>
> Any suggestions of how to do this would be greatly appreciated. I am using
> Lucene Core 6.3.0.
>
> Thank you
>