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 Jamie Johnson <je...@gmail.com> on 2015/12/24 22:15:51 UTC

Limit fields returned in solr based on content

I have what I believe is a unique requirement discussed here in the past to
limit data sent to users based on some marking in the field.

Re: Limit fields returned in solr based on content

Posted by Jamie Johnson <je...@gmail.com>.
I'm currently doing it in a middle tier, but it means I can't return
results from the index to users, instead it needs to always hit the store,
not the end of the world but was hoping I could use the fields in the index
as a quick first view and then get the full result when the user selected
an entry.

Jamie
On Dec 24, 2015 4:26 PM, "Walter Underwood" <wu...@wunderwood.org> wrote:

> I would do that in a middle tier. You can’t do every single thing in Solr.
>
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
>
> > On Dec 24, 2015, at 1:21 PM, Upayavira <uv...@odoko.co.uk> wrote:
> >
> > You could create a custom DocTransformer. They can enhance the fields
> > included in the search results. So, instead of fl=somefield you could
> > have fl=[my-filter:somefield], and your MyFieldDocTransformer makes the
> > decision as to whether or not to include somefield in the output.
> >
> > This would of course, require some Java coding.
> >
> > Upayavira
> >
> > On Thu, Dec 24, 2015, at 09:17 PM, Jamie Johnson wrote:
> >> Sorry hit send too early
> >>
> >> Is there a mechanism in solr/lucene that allows customization of the
> >> fields
> >> returned that would have access to the field content and payload?
> >> On Dec 24, 2015 4:15 PM, "Jamie Johnson" <je...@gmail.com> wrote:
> >>
> >>> I have what I believe is a unique requirement discussed here in the
> past
> >>> to limit data sent to users based on some marking in the field.
> >>>
>
>

Re: Limit fields returned in solr based on content

Posted by Walter Underwood <wu...@wunderwood.org>.
I would do that in a middle tier. You can’t do every single thing in Solr.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)


> On Dec 24, 2015, at 1:21 PM, Upayavira <uv...@odoko.co.uk> wrote:
> 
> You could create a custom DocTransformer. They can enhance the fields
> included in the search results. So, instead of fl=somefield you could
> have fl=[my-filter:somefield], and your MyFieldDocTransformer makes the
> decision as to whether or not to include somefield in the output.
> 
> This would of course, require some Java coding.
> 
> Upayavira
> 
> On Thu, Dec 24, 2015, at 09:17 PM, Jamie Johnson wrote:
>> Sorry hit send too early
>> 
>> Is there a mechanism in solr/lucene that allows customization of the
>> fields
>> returned that would have access to the field content and payload?
>> On Dec 24, 2015 4:15 PM, "Jamie Johnson" <je...@gmail.com> wrote:
>> 
>>> I have what I believe is a unique requirement discussed here in the past
>>> to limit data sent to users based on some marking in the field.
>>> 


Re: Limit fields returned in solr based on content

Posted by Jamie Johnson <je...@gmail.com>.
Would the doc transformer have access to payloads?
On Dec 24, 2015 4:21 PM, "Upayavira" <uv...@odoko.co.uk> wrote:

> You could create a custom DocTransformer. They can enhance the fields
> included in the search results. So, instead of fl=somefield you could
> have fl=[my-filter:somefield], and your MyFieldDocTransformer makes the
> decision as to whether or not to include somefield in the output.
>
> This would of course, require some Java coding.
>
> Upayavira
>
> On Thu, Dec 24, 2015, at 09:17 PM, Jamie Johnson wrote:
> > Sorry hit send too early
> >
> > Is there a mechanism in solr/lucene that allows customization of the
> > fields
> > returned that would have access to the field content and payload?
> > On Dec 24, 2015 4:15 PM, "Jamie Johnson" <je...@gmail.com> wrote:
> >
> > > I have what I believe is a unique requirement discussed here in the
> past
> > > to limit data sent to users based on some marking in the field.
> > >
>

Re: Limit fields returned in solr based on content

Posted by Upayavira <uv...@odoko.co.uk>.
You could create a custom DocTransformer. They can enhance the fields
included in the search results. So, instead of fl=somefield you could
have fl=[my-filter:somefield], and your MyFieldDocTransformer makes the
decision as to whether or not to include somefield in the output.

This would of course, require some Java coding.

Upayavira

On Thu, Dec 24, 2015, at 09:17 PM, Jamie Johnson wrote:
> Sorry hit send too early
> 
> Is there a mechanism in solr/lucene that allows customization of the
> fields
> returned that would have access to the field content and payload?
> On Dec 24, 2015 4:15 PM, "Jamie Johnson" <je...@gmail.com> wrote:
> 
> > I have what I believe is a unique requirement discussed here in the past
> > to limit data sent to users based on some marking in the field.
> >

Re: Limit fields returned in solr based on content

Posted by Jamie Johnson <je...@gmail.com>.
Sorry hit send too early

Is there a mechanism in solr/lucene that allows customization of the fields
returned that would have access to the field content and payload?
On Dec 24, 2015 4:15 PM, "Jamie Johnson" <je...@gmail.com> wrote:

> I have what I believe is a unique requirement discussed here in the past
> to limit data sent to users based on some marking in the field.
>