Hi Jörn Franke,

  I modified the custom function to just return a constant value as 1.0 for
all the docs and ran the load again, the latency is worst like more than
20sec. The filter I am using will fetch 15k documents (so this function is
called 15k times). And if I don't call this function in my query then
latency is less than 10ms.

So it looks like some fundamental issue with this approach and I believe
its been used in many business scenarios. Looking out for what's going
 wrong.

Thanks,
Sripradeep P


On Wed, Nov 27, 2019 at 1:00 PM Jörn Franke <jornfra...@gmail.com> wrote:

> And have you tried how fast it is if you don’t do anything in this method?
>
> > Am 27.11.2019 um 07:52 schrieb Sripra deep <sriprad...@madstreetden.com
> >:
> >
> > Hi Team,
> >  I wrote a custom sort function that will read the field value and parse
> > and returns a float value that will be used for sorting. this field is
> > indexed, stored and docvalues enabled. my latency increases drastically
> > from 10ms when the filter loads 50 documents and 200ms when it loads 250
> > documents and 1sec when it loads 1000 documents.
> >
> > This is my function:
> >
> > @Override
> > public FunctionValues getValues(Map context, LeafReaderContext reader)
> > throws IOException {
> > final FunctionValues vals = source.getValues(context, reader);
> > return new FunctionValues() {
> >        public float floatVal(int doc) {
> >        float toRet = isasc ? Float.MAX_VALUE : Float.MIN_VALUE;
> >        /*
> >        My custom logic in reading a string array and returning a value
> out
> > of some condition checks
> >        */
> >        }
> >    }
> > }
> >
> > Can you suggest me some suggestions on this ?
> >
> > Thanks,
> > Sripradeep P
>

Reply via email to