Re: Pb searching a word in a string
Posted in 1996
With your requirements to optimise for a large database: no you can't do this. What you can, and should do, is get the beta version of Universal Server. (According to Kerry's rumours it should be out soon.) It includes a text search datablade which should be able to do this and much more. That's the one and only right way of doing text search inside a database. However: On the database you have you request: "without using AND or OR clause in the select request (cauz the database is really huge, and I must optimize everywhere)". Why is this a problem. Any search using "*exam*" (an * first) whould lead to a sequential search anyway. I don't think a few additional and/or clauses would make that much of a difference - although remembering the discussion about dates beeing converted badly, may be it will take time. You might want to test someting along the lines of xx matches "exam *" or xx matches "* exam *" or xx matches "* exam" while you wait for the Universal Server. Add additional clauses with , : or whatever for the space for other word delimiting characters. Yes, if you want to test for every option there is a definite risk that this will become slow, perhaps even very slow. pdemeyer@tmphard.univ-lr.fr wrote: :Hi there! :Here is the problem: :Using OInformix, what is the trick to find a word in a string, but only THIS :word. An example would be better : :My fields are : "i flunked my exam" and "this is an example" :If i want to find fields which contain the word 'exam', with the simple syntax :*exam*, it will find the 2 fields, but I don't want the second one here. : The difficulty here is to find the trick which works in every case, :even if the searched word is at the beginning or at the end of the string, :thinking that we could have other word separators than the space character :(for example a comma character, the ':' character ...) and without using AND :or OR clause in the select request (cauz the database is really huge, and I :must optimize everywhere). :Any help would be appreciated (even if you tell me that we can't do this). :Thanx a lot :----------------------- :Patrice :pdemeyer@cri.univ-lr.fr Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company