From java-user-return-64732-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Jan 24 18:43:04 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C9C2018064E for ; Fri, 24 Jan 2020 19:43:03 +0100 (CET) Received: (qmail 33272 invoked by uid 500); 24 Jan 2020 18:43:02 -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 33251 invoked by uid 99); 24 Jan 2020 18:43:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jan 2020 18:43:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 85835C1D07 for ; Fri, 24 Jan 2020 18:43:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.503 X-Spam-Level: X-Spam-Status: No, score=-2.503 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=oracle.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id t971AMhL2WXj for ; Fri, 24 Jan 2020 18:42:59 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=141.146.126.78; helo=aserp2120.oracle.com; envelope-from=baris.kazar@oracle.com; receiver= Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 391807E139 for ; Fri, 24 Jan 2020 18:42:58 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00OIcBJY062876 for ; Fri, 24 Jan 2020 18:42:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=Cy0pYPL5WfcGCzVyGA9J6jrh1bgVtzQmp3axHK30QYE=; b=neihplkOiYzbZ4QzvnrS1bSgVAFfRpaUC28WFG395SliDJO6Ypzf8MSe1jZoTpnoz3RO 0hBRBuTgVmmNKQiaOGxxXdV5MgGdrULhSF0eknhZHU9duQ/4zvt+KyYZPFH2GvFHdTDF fV84qin7XNK/bFabkYDYLPcBJwqhK8Y5cpWpRN97H45pzwjww/hKH8sU6TPlXnHanNVi vCoYXctxQ7OVE54f5+xc0sr5VdVZH0bNwyUxDV4Qvn7JjpxYUk5O0Y5LGlPpfzFnvVdy yWP1+9xfaj5CEKvEpzTb8T19vqQiX3vFJw8dAsdac19VD+GyVHVq4VA1VFBLsODnvdBN yg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2xksyqtqa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 24 Jan 2020 18:42:57 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00OIdlLR077409 for ; Fri, 24 Jan 2020 18:40:56 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2xqmv0j6x6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 24 Jan 2020 18:40:56 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00OIetp4008012 for ; Fri, 24 Jan 2020 18:40:55 GMT Received: from [10.149.251.6] (/10.149.251.6) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 24 Jan 2020 10:40:55 -0800 Subject: Re: PhraseQuery To: java-user@lucene.apache.org References: <3e984f37-b15b-625c-8c18-d72b026fb02c@oracle.com> Cc: "baris.kazar" From: baris.kazar@oracle.com Organization: Oracle Corporation Message-ID: Date: Fri, 24 Jan 2020 13:45:02 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9510 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001240152 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9510 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001240152 Thanks for the quick responses, i was having a bug in my code such that i was building multiple PhraseQuery's instead of one PhraseQuery in a loop. Then i was losing order of terms. Best regards On 1/24/20 12:54 PM, Michael Froh wrote: > Did you check the Javadoc for PhraseQuery.Builder? > > https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_core_6-5F5-5F0_core_org_apache_lucene_search_PhraseQuery.Builder.html&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=IKZsplnvxeAys8KTpnZUR9To3moViZLv2LQHnuL4uHQ&s=mgj0lNuzP2IfQzWZHxdRe4UQQ-n-e8Yy5abEIS1Ieik&e= > > Checking the source code, I see that the add method that takes a position > argument will throw an IllegalArgumentException if you try to add a Term in > a lower position than the previous Term. (That is, Term positions must be > non-decreasing.) > > Hope that helps, > Michael > > On Fri, 24 Jan 2020 at 09:45, wrote: > >> Hi,- >> >> how do i enforce the order of sequence of terms in the PhraseQuery >> builder? >> Lucene docs are very hard to understand in terms of api descriptions. >> >> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__lucene.apache.org_core_6-5F5-5F0_core_org_apache_lucene_search_PhraseQuery.html&d=DwIBaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=nlG5z5NcNdIbQAiX-BKNeyLlULCbaezrgocEvPhQkl4&m=IKZsplnvxeAys8KTpnZUR9To3moViZLv2LQHnuL4uHQ&s=8d1QBLJg0ltQqzGEk_Z40SzkBZsgdjglTrmyjnJ0rbs&e= >> Best regards >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org