incubator-blur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron McCurry <amccu...@gmail.com>
Subject Re: Facets
Date Fri, 18 Oct 2013 12:20:13 GMT
I have an issue in Jira to document facets in 0.2.1, it's not been worked
yet but I hope I can get to it soon.  It looks like you figured out what is
there.

We will likely improve facets in 0.3.0 so the API will have to change a
bit.  The biggest change we will need to make is the scenario that you
bring up.  Facets in the current implementation case are simply other
queries that can range from a single term to a complex query.  I'm assuming
that you would like to specify a field name and get something like a map of
terms to counts for the given facet?

The field facetCounts are counts that each of the facets in the input list
from the query.  So the count list corresponds one for one to the facet
list in the Query.  I realize this is less than ideal and we can going to
be improving it soon.

If you have some suggestions on how you would want the facet api to
operate, new features, or anything else for that matter just write up your
thoughts on this thread and we can incorporate them into the task.

Thanks!

Aaron



On Fri, Oct 18, 2013 at 6:43 AM, Colton McInroy <colton@dosarrest.com>wrote:

> Ok, so I created this method...
>
> public static BlurResults queryBlur(String queryString, String table) {
>         Iface client = BlurClient.getClient(**mainConfig.getString("**
> controllers"));
>         Query query = new Query();
>         query.setQuery(queryString);
>
>         Selector selector = new Selector();
>
>         // This will fetch all the columns in family "fam0".
>         selector.**addToColumnFamiliesToFetch("**event");
>         selector.**addToColumnFamiliesToFetch("**msg");
>
>         BlurQuery blurQuery = new BlurQuery();
>         List<Facet> facets = Arrays.asList(new Facet(queryString,
> Long.MAX_VALUE));
>         blurQuery.setFacets(facets);
>         blurQuery.setFetch(50);
>         blurQuery.setQuery(query);
>         blurQuery.setSelector(**selector);
>
>         try {
>             BlurResults results = client.query(table, blurQuery);
>             return results;
>         } catch (BlurException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         } catch (TException e) {
>             // TODO Auto-generated catch block
>             e.printStackTrace();
>         }
>         return null;
>     }
>
> From reading through source code, I was able to find out that you specify
> facets as a list, but this is fairly confusing to me coming from lucene.
>
> In lucene when getting facet data, I specify the facet fields I am
> interested in, and the facet results show me a top X list of values within
> that field. Whereas with blur, it appears that a facet is another query
> which gives only a number as a result. When I tried to obtain the facet
> data I am used to with Lucene, the only thing I could find was...
>
> System.out.println("Facet Results: "+results.getFacetCountsSize()**);
> System.out.println(JSONArray.**toJSONString(results.**getFacetCounts()));
>
> Could you please elaborate on this.
>
>
> Thanks,
> Colton McInroy
>
>  * Director of Security Engineering
>
>
> Phone
> (Toll Free)
> _US_    (888)-818-1344 Press 2
> _UK_    0-800-635-0551 Press 2
>
> My Extension    101
> 24/7 Support    support@dosarrest.com <mailto:support@dosarrest.com>
> Email   colton@dosarrest.com <mailto:colton@dosarrest.com>
> Website         http://www.dosarrest.com
>
> On 10/18/2013 3:07 AM, Colton McInroy wrote:
>
>> I think I wrote this to soon, I believe I just found out how to do it.
>> I'll test it out and supply some example code if correct to help others.
>>
>> Thanks,
>> Colton McInroy
>>
>>  * Director of Security Engineering
>>
>>
>> Phone
>> (Toll Free)
>> _US_     (888)-818-1344 Press 2
>> _UK_     0-800-635-0551 Press 2
>>
>> My Extension     101
>> 24/7 Support     support@dosarrest.com <mailto:support@dosarrest.com>
>> Email     colton@dosarrest.com <mailto:colton@dosarrest.com>
>> Website     http://www.dosarrest.com
>>
>> On 10/18/2013 2:58 AM, Colton McInroy wrote:
>>
>>> Hey Aaron,
>>>
>>>     You mentioned a while ago that blur handles facets as well and that
>>> you would provide an example. Unless I have missed that email, I haven't
>>> seen an example yet, could you provide one? I just took a quick look myself
>>> and could not figure it out. I see there is an example FacetQueryTest.java
>>> in blur-query but that appears to be basically just a copy of the lucene
>>> file.
>>>
>>>
>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message