> On Jan 26, 2015, at 2:34 PM, Julio Albuquerque <[email protected]>
> wrote:
>
> But it is not in query.Run () that should take? Not in query.Run () that runs
> the Map Function?
> In line foreach (var line in lines) that will run the Map Function?
No. The first thing Query.Run does is check if the index is out of date. If so,
it updates the index. This is done by fetching every document that's been
modified (or added) since the index was last updated, running it through the
map function, and adding the emitted key/value pairs to the index. (Also,
obsolete key/value pairs are removed.)
Then it queries the index and returns all of the docs that match your query
settings.
Your map function looks reasonable, but it's doing a fair amount of work. I'd
suggest profiling that long delay and seeing where the time is being spent. You
may be able to optimize the map function.
Actually I just noticed one obvious optimization — you're evaluating this
expression twice, and it's probably expensive because it sounds like it's doing
Unicode string manipulation:
Tools.RemoverAcentos (titulos [i].Value<string>("descricao").ToLower
()).Trim ()
—Jens
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/F5293182-CCBA-4F85-A636-4061A88507A5%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.