Hello Mikhail,

I've tried it and the query executes, but it does not treat strdist() as a
function to execute.
Looks like each part of the function - it's name and parameters - are
treated as keywords to search for against the default field.

If I try something different:

   q=+firstName:Adam +{!parent which=type:record v=$chq}&chq=+type:address
+{!func}strdist('Shakespeare',address.street, edit)

then I get exception:
  org.apache.solr.search.SyntaxError: Missing end to unquoted value
starting at 37 str='strdist('Shakespeare',address.street,'

Best regards,
Dariusz Wojtas




On Tue, Jan 16, 2018 at 4:04 AM, Mikhail Khludnev <m...@apache.org> wrote:

> Hello, Dariusz.
>
> It should be something like
> q=+firstName:Adam +{!parent which=type:record
> v=$chq}&chq=+type:address +strdist('Shakespeare',
> address.street, edit)
> post exception if it doesn't work.
>
> On Tue, Jan 16, 2018 at 1:39 AM, Dariusz Wojtas <dwoj...@gmail.com> wrote:
>
> > Hi,
> >
> > Is it possible to use the strdist() function to return distance on the
> > child document field?
> > Let's say I have:
> >
> > <doc>
> >    <str name="id">1</str>
> >    <str name="type">record</str>
> > <str name="firstName">Adam</str>
> > <doc>
> >       <str name="id">A1</str>
> >       <str name="type">address</str>
> >       <str name="address.type">business</str>
> >       <str name="address.street">Shakespeare</str>
> > </doc>
> > <doc>
> >       <str name="id">A2</str>
> >       <str name="type">address</str>
> >       <str name="address.type">correspondence</str>
> >       <str name="address.street">Baker Street</str>
> > </doc>
> > </doc>
> >
> > What I want to do is to search for documents:
> >   type:record
> >   firstName:Adam
> >   and return max strdist('Shakespeare', address.street, edit) as the
> > resulting score?
> >
> > or
> >   type:record
> >   firstName:Adam
> >   and return max strdist('Shakespeare', address.street, edit) of
> > "address.type:business" as the resulting score?
> >
> > I am trying with the {!parent} mode and {!function}, various
> combinations.
> > But I do not get what I'd expect.
> >
> > Best regards,
> > Dariusz Wojtas
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Reply via email to