Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-10 Thread Teodor Sigaev
I meant that the expansion of 'hu%' is done before and outside of tsearch, so the question is how efficient will tsearch be for searching for hudreds or thousands of words in one expression. Ok, I see. The answer - bad. Index structure is signature tree with constant signature length, by default 2

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-10 Thread Hannu Krosing
Teodor Sigaev kirjutas K, 10.12.2003 kell 11:20: > >>Tsearch was never minded as prefix search, and index structure doesn't support > >>any kind of prefix or suffix. But you can write extension to tsearch, which will > >>search by prefix. But such solution wiil not use index, only sequence scan.

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-10 Thread Teodor Sigaev
Tsearch was never minded as prefix search, and index structure doesn't support any kind of prefix or suffix. But you can write extension to tsearch, which will search by prefix. But such solution wiil not use index, only sequence scan. How efficient would tsearch be for really big expressions (

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-09 Thread Hannu Krosing
Teodor Sigaev kirjutas T, 09.12.2003 kell 23:07: > Urmo wrote: > > Hi, > > > > there seems to be no way of searching partial matches with tsearch. > > Would it be hard to implement prefix based matching, i.e. > > "hu" matches "human", "humanity", "humming", "huge"? With some hacking I > > manage

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-09 Thread Teodor Sigaev
managed to disable morphology part from tsearch1 (database contained multiple languages in a single table so morphology could not be used) BTW, why? How many are languages in one record possible? tsearch V2 allows to use many dictionaries for each type of lexeme and you can write your own dicti

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-09 Thread Teodor Sigaev
Urmo wrote: Hi, there seems to be no way of searching partial matches with tsearch. Would it be hard to implement prefix based matching, i.e. "hu" matches "human", "humanity", "humming", "huge"? With some hacking I managed to disable morphology part from tsearch1 (database contained multiple

Re: [HACKERS] Searching for substring with tsearch(1/2)

2003-12-09 Thread Urmo
Little important fact: it is not the indexing taking so long with FTS. It is filling the fulltext table before creating indexes on it. I have table A with with a column searchtext and trigger to create FTS records of it in table cdsfti. So to fill the cdsfti table I did UPDATE A SET oneintegerc

[HACKERS] Searching for substring with tsearch(1/2)

2003-12-09 Thread Urmo
Hi, there seems to be no way of searching partial matches with tsearch. Would it be hard to implement prefix based matching, i.e. "hu" matches "human", "humanity", "humming", "huge"? With some hacking I managed to disable morphology part from tsearch1 (database contained multiple languages in a