Received: by 10.68.227.230 with SMTP id sd6mr15274645pbc.8.1334168805919; Wed, 11 Apr 2012 11:26:45 -0700 (PDT) X-BeenThere: cleo-typeahead@googlegroups.com Received: by 10.68.223.72 with SMTP id qs8ls4744910pbc.6.gmail; Wed, 11 Apr 2012 11:26:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.219.35 with SMTP id pl3mr3805977pbc.15.1334168805814; Wed, 11 Apr 2012 11:26:45 -0700 (PDT) Authentication-Results: ls.google.com; spf=pass (google.com: domain of jingwei...@gmail.com designates internal as permitted sender) smtp.mail=jingwei...@gmail.com; dkim=pass header...@gmail.com Received: by to5g2000pbc.googlegroups.com with HTTP; Wed, 11 Apr 2012 11:26:45 -0700 (PDT) Date: Wed, 11 Apr 2012 11:26:45 -0700 (PDT) In-Reply-To: <1bb64d9b-07a6-43f3-a666-2ae20cca99e3@er9g2000vbb.googlegroups.com> References: <6df9545f-2b20-489b-9fab-9491ac48a6a0@k6g2000vbz.googlegroups.com> <47747a87-6c56-4f9c-855e-673be96b067c@h20g2000yqd.googlegroups.com> <1bb64d9b-07a6-43f3-a666-2ae20cca99e3@er9g2000vbb.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_3) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11,gzip(gfe) Message-ID: <08b6b3d7-6d29-44f2-89b0-04fafa56ceff@to5g2000pbc.googlegroups.com> Subject: Re: Does GenericTypeahead always return the results with the highest score? From: Jingwei To: Cleo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Partitions will help since requests are evaluated in parallel. Partition is based on elementID. You may want to experiment with your data sets to see how many partitions you can hold on one box in order to have acceptable performance. Best Jingwei On Apr 10, 11:58=A0am, yuan wrote: > Thanks Jingwei: > > =A0We need return the highest score, we also expect low latency. =A0But i= f > the inverted list is long, it may take long to process the entire > list. > I am not sure whether there are some ways to contorl the maximum lengh > of the inverted list. =A0 I see you mentioned cleo partition in the > document. Looks like =A0the partition is based on elementID rather than > prefix? > > If the partition is based on elelmentID, the maximum length of the > invered list may not be very long. But a single query will touch all > of partitions. =A0In a distributed system, it means it will touch all of > nodes. I am understanding correctly? > > Thanks. > > Yuan > > On Apr 10, 12:54=A0am, Jingwei wrote: > > > > > > > > > Hi, > > > Please see my reply below. > > > On Apr 9, 9:01=A0pm, yuan wrote: > > > > Hi: > > > > I have a couple of questions about GenericTypeahead =A0after looked a= t > > > the code of cleo. > > > > (1) Looks like GenericTypeahead return all of matched elements. Is > > > this correct? > > > =A0 =A0 If it is true, what if a key(term) are matched with lots of > > > elements? For example, 1 million. =A0It will comsumes lots of memory = and > > > increase latence. > > > This really depends on the type of Collector you are using. There are > > several different types Collector you can use to return over 1 million > > elements or top 10 elements. Choose the collector that suits your > > needs. > > > > (2) In the indexDataStore, looks like elements are not sorted by > > > score. =A0Also, the seach() function has a paramter timeoutMillis. > > > What if the function search() reutrn earlier because of > > > timeoutMillis, =A0can =A0GenericTypeahead =A0guarntee return elemetns= with > > > the highest score? > > > For typeahead, as a user is typing more characters, the search scope > > is narrowing down quickly. The timeoutMillis is for early termination > > to guarantee response time but not full coverage. If your program > > really need to find the elements with the highest score, you should > > NOT consider using timeout. > > > > Thanks a lot for the great project. > > > > Yuan- Hide quoted text - >