Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A75D9DB35 for ; Thu, 5 Jul 2012 06:11:14 +0000 (UTC) Received: (qmail 55796 invoked by uid 500); 5 Jul 2012 06:11:11 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 55627 invoked by uid 500); 5 Jul 2012 06:11:10 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 55604 invoked by uid 99); 5 Jul 2012 06:11:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 06:11:10 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of chamnapchhorn@gmail.com designates 209.85.214.176 as permitted sender) Received: from [209.85.214.176] (HELO mail-ob0-f176.google.com) (209.85.214.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 06:11:03 +0000 Received: by obbtb18 with SMTP id tb18so5608492obb.35 for ; Wed, 04 Jul 2012 23:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=QP5+VpTn42L+AsQtSeBH/AJE8k+A9GkOt9ex0zTxCHM=; b=OGTQkImNbeo9JOtXX7iyPInL4hWUbfuX2BmZFu5YsReldJrn0W/YABK0EMUlVH8Aa0 WJwcCvz2TeQP1hpMbFf7VyG8vVq9TA11XTb5KA7mA1hik44CFIMqy8J0q9t+I1UfTyvR RqZrEAUk35vElAl4IM9TneqSjX6C/kor7KFsus7/irOqBXRlkTXhcbqBl+/HLuJX5d/o v0yhXqWXgMDsTKtYOgU8iyobyTE08WW6hDvQxRYeivWzSHwf/TpOQiv7bmqxctX7xVb0 BZBXVGOo305OqvNvhbSEjpKe3D1kwdf5y26PilXvRSL39XgFvFeU4C8ryjMGfnv4Kfjp sxDQ== Received: by 10.60.25.6 with SMTP id y6mr25639791oef.42.1341468642345; Wed, 04 Jul 2012 23:10:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.140.164 with HTTP; Wed, 4 Jul 2012 23:10:22 -0700 (PDT) In-Reply-To: References: From: Chamnap Chhorn Date: Thu, 5 Jul 2012 13:10:22 +0700 Message-ID: Subject: Re: How to improve this solr query? To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=e89a8fb1eef2e784ef04c40f01c2 --e89a8fb1eef2e784ef04c40f01c2 Content-Type: text/plain; charset=ISO-8859-1 Hi Amit, Thanks for your response. 1. It's just sometimes I see solr doesn't sort by score desc, so I made it like that. I will have to check that again. 2. q1 and q2 are doing the search but just on different fields. String fields means that it must match exactly, and solr need the q parameter to be quoted. I did a nested query with the OR operator. I'll check out the bf, pf, bq parameter more. Thanks for the advise. :) On Wed, Jul 4, 2012 at 2:28 PM, Amit Nithian wrote: > Couple questions: > 1) Why are you explicitly telling solr to sort by score desc, > shouldn't it do that for you? Could this be a source of performance > problems since sorting requires the loading of the field caches? > 2) Of the query parameters, q1 and q2, which one is actually doing > "text" searching on your index? It looks like q1 is doing non-string > related stuff, could this be better handled in either the bf or bq > section of the edismax config? Looking at the sample though I don't > understand how q1=apartment would hit non-string fields again (but see > #3) > 3) Are the "string" fields literally of string type (i.e. no analysis > on the field) or are you saying string loosely to mean "text" field. > pf ==> phrase fields ==> given a multiple word query, will ensure that > the specified phrase exists in the specified fields separated by some > slop ("hello my world" may match "hello world" depending on this slop > value). The "qf" means that given a multi term query, each term exists > in the specified fields (name, description whatever text fields you > want). > > Best > Amit > > On Mon, Jul 2, 2012 at 9:35 AM, Chamnap Chhorn > wrote: > > Hi all, > > > > I'm using solr 3.5 with nested query on the 4 core cpu server + 17 Gb. > The > > problem is that my query is so slow; the average response time is 12 secs > > against 13 millions documents. > > > > What I am doing is to send quoted string (q2) to string fields and > > non-quoted string (q1) to other fields and combine the result together. > > > > > facet=true&sort=score+desc&q2=*"apartment"*&facet.mincount=1&q1=*apartment* > > > &tie=0.1&q.alt=*:*&wt=json&version=2.2&rows=20&fl=uuid&facet.query=has_map:+true&facet.query=has_image:+true&facet.query=has_website:+true&start=0&q= > > * > > > _query_:+"{!dismax+qf='.....'+fq='......'+v=$q1}"+OR+_query_:+"{!dismax+qf='......'+fq='.......'+v=$q2}" > > * > > > &facet.field={!ex%3Ddt}sub_category_uuids&facet.field={!ex%3Ddt}location_uuid > > > > I have done solr optimize already, but it's still slow. Any idea how to > > improve the speed? Am I done anything wrong? > > > > -- > > Chhorn Chamnap > > http://chamnap.github.com/ > -- Chhorn Chamnap http://chamnap.github.com/ --e89a8fb1eef2e784ef04c40f01c2--