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 Alexandre Rafalovitch <ar...@gmail.com> on 2018/10/05 14:24:41 UTC
Does SolrJ support JSON DSL?
Hi,
Does anybody know if it is possible to do the new JSON DSL and JSON
Facets requests via SolrJ. The SolrJ documentation is a bit sparse and
I don't often use it. So, I can't figure out if there is a direct
support or even a pass-through workaround.
Thank you,
Alex.
Re: Does SolrJ support JSON DSL?
Posted by Christian Ortner <ch...@gmail.com>.
On Sat, Oct 6, 2018 at 1:04 AM Chris Hostetter <ho...@fucit.org>
wrote:
> Which is to say: there are no explicit convenience methods for it, but you
> can absolutely use the JSON DSL and JSON facets via SolrJ and the
> QueryRequest -- just add the param key=value that you want, where the
> value is the JSON syntax...
>
For more convenience with relatively complex JSON facet queries, I like
having some data classes and enums that make building a valid JSON facet
data structure faster and safer. In the end, just before sending the query,
I just use Jackson to turn the object graph into JSON.
Re: Does SolrJ support JSON DSL?
Posted by Chris Hostetter <ho...@fucit.org>.
: There's nothing out-of-the-box.
Which is to say: there are no explicit convenience methods for it, but you
can absolutely use the JSON DSL and JSON facets via SolrJ and the
QueryRequest -- just add the param key=value that you want, where the
value is the JSON syntax...
ModifiableSolrParams p = new ModifiableSolrParams()
p.add("json.facet","{ ... }");
// and/or: p.add("json", "{ ... }");
QueryRequest req = new QueryRequest(p, SolrRequest.METHOD.POST);
QueryResponse rsp = req.process(client);
: On Fri, Oct 5, 2018 at 5:34 PM Alexandre Rafalovitch <ar...@gmail.com>
: wrote:
:
: > Hi,
: >
: > Does anybody know if it is possible to do the new JSON DSL and JSON
: > Facets requests via SolrJ. The SolrJ documentation is a bit sparse and
: > I don't often use it. So, I can't figure out if there is a direct
: > support or even a pass-through workaround.
: >
: > Thank you,
: > Alex.
: >
:
:
: --
: Sincerely yours
: Mikhail Khludnev
:
-Hoss
http://www.lucidworks.com/
Re: Does SolrJ support JSON DSL?
Posted by Mikhail Khludnev <mk...@apache.org>.
There's nothing out-of-the-box.
On Fri, Oct 5, 2018 at 5:34 PM Alexandre Rafalovitch <ar...@gmail.com>
wrote:
> Hi,
>
> Does anybody know if it is possible to do the new JSON DSL and JSON
> Facets requests via SolrJ. The SolrJ documentation is a bit sparse and
> I don't often use it. So, I can't figure out if there is a direct
> support or even a pass-through workaround.
>
> Thank you,
> Alex.
>
--
Sincerely yours
Mikhail Khludnev