hello all,

a new user here. I will be using solr to power the search over at
freesound ( http://freesound.iua.upf.edu ).

been experimenting with solr and it's damned cool :)

here we go:

1. I have a minor remark about the inconsistencies in the
query-parameter definitions... Sometimes multiple fields are given
with comma/space-separated values, sometimes they are given by
repeating the parameter:
sort=field1,field2 desc,field3
but
facet.field=field1&facet.field=field2
This is pretty confusing to first-hand users! :-)

2. two questions about the query syntax:

is
   tag:(bass drum)
the same as:
   tag:bass OR tag:drum
or the same as:
   tag:bass AND tag:drum
or neither?

is "+bass +drum" essentially the same as "bass AND drum" ?


I'm working on a query/parameter builder in python. It's work in
progress but you can see what's been done over here:
http://iua-share.upf.edu/svn/nightingale/trunk/sandbox/solr/solrquery.py
it's basically a wrapper around all the parameters you can pass via
the GET string to SOLR so you can do things like:

    q = SolrQuery()
    q.set_query("tag:bass")
    q.set_query_options(start=0, rows=10, sort=["date desc"],
field_list=["id", "tag", "description"])
    q.add_facet_field("author")
    q.add_facet_field("tag")
    q.set_global_facet_options(limit=20, count_missing=True)
    q.set_facet_options("tag", mincount=5)
    q.add_date_facet("date_written")
    q.set_global_date_facet_options(start="-2YEARS", end="-1YEARS",
gap="+1MONTH", count_other=["before", "after"])
    print q.get_query_string()

which results in:

sort=date+desc&facet.date.gap=%2B1MONTH&facet.field=author&facet.field=tag&facet.date=date_written&facet=true&facet.date.start=-2YEARS&facet.date.end=-2YEARS&fl=id%2Ctag%2Cdescription&facet.date.other=before&facet.date.other=after&rows=10&facet.missing=true&facet.limit=20&start=0&wt=json&q=tag%3Abass&f.tag.facet.mincount=5



 - bram

-- 
http://freesound.iua.upf.edu
http://www.smartelectronix.com
http://www.musicdsp.org

Reply via email to