X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 47B469DC896 for ; Mon, 23 Jan 2006 12:44:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 84013-03 for ; Mon, 23 Jan 2006 12:44:30 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id D8EC49DC865 for ; Mon, 23 Jan 2006 12:44:29 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k0NGiOwk025748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Jan 2006 09:44:26 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id k0NGiOOJ032113; Mon, 23 Jan 2006 09:44:24 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k0NGiLCx032112; Mon, 23 Jan 2006 09:44:21 -0700 (MST) (envelope-from mfuhr) Date: Mon, 23 Jan 2006 09:44:21 -0700 From: Michael Fuhr To: "Praveen Kumar (TUV)" Cc: brad@kieser.net, pgsql-admin@postgresql.org Subject: Re: Full Text Indexing Using Tsearch2-Module Message-ID: <20060123164421.GA28344@winnie.fuhr.org> References: <84D57263D486374587DA0820E60A2CC60724E1@srit_mail.renaissance-it.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84D57263D486374587DA0820E60A2CC60724E1@srit_mail.renaissance-it.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.108 required=5 tests=[AWL=0.108] X-Spam-Score: 0.108 X-Spam-Level: X-Archive-Number: 200601/268 X-Sequence-Number: 20356 On Mon, Jan 23, 2006 at 03:05:07PM +0530, Praveen Kumar (TUV) wrote: > I have installed Tsearch-Module for full text indexing .But when > I search text using gist(idxFTI) index on table I also found all > data which have same accent.Example > 1.If I try search for MANI word it also search for MANY word. > 2.If I try search for ANDY word it also search for ANDI word. > Please can you tell me how to avoid this problem ? If i want to > search text MANI it should search only for MANI not MANY. Your tsearch2 configuration is turning the words "many" and "andy" into the lexemes "mani" and "andi", like this: test=> SELECT * FROM ts_debug('many andy'); ts_name | tok_type | description | token | dict_name | tsvector ---------+----------+-------------+-------+-----------+---------- default | lword | Latin word | many | {en_stem} | 'mani' default | lword | Latin word | andy | {en_stem} | 'andi' (2 rows) To learn how to change that see "Parsing and Lexing" and "Configurations" in the tsearch2 documentation: http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch2-guide.html#parsing_lexing http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/docs/tsearch2-ref.html#configurations Another approach is to think of tsearch2 as returning "might match" rows and add another restriction to find the definite matches: test=> SELECT * FROM foo test-> WHERE idxcontent @@ to_tsquery('many'); id | content | idxcontent ----+---------+------------ 1 | many | 'mani':1 2 | mani | 'mani':1 (2 rows) test=> SELECT * FROM foo test-> WHERE idxcontent @@ to_tsquery('many') AND content ~* 'many'; id | content | idxcontent ----+---------+------------ 1 | many | 'mani':1 (1 row) -- Michael Fuhr