Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8986CCE65 for ; Mon, 21 May 2012 18:37:06 +0000 (UTC) Received: (qmail 3671 invoked by uid 500); 21 May 2012 18:37:04 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 3529 invoked by uid 500); 21 May 2012 18:37:04 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 3521 invoked by uid 99); 21 May 2012 18:37:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 18:37:04 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mohitanchlia@gmail.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-yx0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 May 2012 18:36:59 +0000 Received: by yenm14 with SMTP id m14so5968129yen.35 for ; Mon, 21 May 2012 11:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=lbvKXpGPzspJTUweu9HzMRK3d/bHz/8ILRsFOMhhjHA=; b=Afgr0lJ4Hk7VHYoFihnaooKpkuEpxPuaHCEZE/D+zSwwMUnSmbwaOyXp3fAGsioJwM AP1q3dq+zaZQU1TQKC3kW8RNmnUv12QXXnyz0kU+zj7VfsvMu6Do0YKezR5gwD8T/WRP RdgdxQaQmQ/R9kTl+24IYzVq39Xd/BUBd8Of236QBOxwl1YU3NSqc2bE3q9UvGq1yddx OEuZbJ3L+gOdHhpuiHIj5aqo4aaiL+uH4mezbSnzWSJ2UvCxfkmV1ZCI+VvNpGyjFep/ pJdIGocByYnXRZJ4fhthTQYBTmBy5TelE6/d2iKiD/vMc1xLnykBKSC7cRj/8fumvvJ+ AtzA== MIME-Version: 1.0 Received: by 10.43.131.201 with SMTP id hr9mr13474096icc.8.1337625398038; Mon, 21 May 2012 11:36:38 -0700 (PDT) Received: by 10.64.141.49 with HTTP; Mon, 21 May 2012 11:36:38 -0700 (PDT) Date: Mon, 21 May 2012 11:36:38 -0700 Message-ID: Subject: Searching accross 2 fields From: Mohit Anchlia To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=20cf307f34c8b151a204c0902ea8 X-Virus-Checked: Checked by ClamAV on apache.org --20cf307f34c8b151a204c0902ea8 Content-Type: text/plain; charset=ISO-8859-1 I am new to search and just went through some concepts of "Lucene in Action". I have few questions: Problem I am having is this. Say I have these json docs for eg. Now I want to query forms.id = 40 and fields.id = L31A and fields.value = 3000. I expect it to return doc 1. But with the regular search I'll also get doc 2. What's the best way of designing search for such queries? Json doc 1 { "fileName":"filename", "createdDate":"05/20/12 16:21:56", "setModel":[ { "id":"1", "compliance":false, "forms":[ { "id":"40", "copy":null, "tpsId":null, "forms":[ { "id":"F40_SW_2", "copy":null, "tpsId":"1[]/F40[]", "forms":[ ], "tables":[ ], "fields":[ { "id":"L31A", "security":null, "value":"3000." }, { "id":"MRSSN1", "security":null, "value":"656465464" } ] } ] } } Json doc 2 { "fileName":"filename", "createdDate":"05/20/12 16:21:56", "setModel":[ { "id":"1", "compliance":false, "forms":[ { "id":"50", "copy":null, "tpsId":null, "forms":[ { "id":"F50_SW_2", "copy":null, "tpsId":"1[]/F50[]", "forms":[ ], "tables":[ ], "fields":[ { "id":"L31A", "security":null, "value":"3000." }, { "id":"MRSSN1", "security":null, "value":"656465464" } ] } ] } --20cf307f34c8b151a204c0902ea8--