ricardito Posted July 28, 2003 Posted July 28, 2003 Hi, I'm working on a project where a search is done on a field that has a lot of spaces, multiple words, etc (it's scientific stuff). I can put on the web page to enter the search string surrounded by asterisk and quotations, *"Alpha" as an example, which will find AlphaOmega, Alpha Omega, Omega (Alpha), BetaAlpha, etc. but is there a way I can do this without the user having to do it? R
Unable Posted July 28, 2003 Posted July 28, 2003 Yes, there is! Look in your CDML Reference database under the variable tag -Op.
ricardito Posted July 28, 2003 Author Posted July 28, 2003 Thanks. It works, however it's a bit misleading. The FM seach is *"word" but the CDML reference says it's "word" which does not work in FM thus I was curious if there was a way to combine the *"". In the database I'm using fnding "SP" in FM returns 1 result, finding *"SP" returns all instances of the string. The "cn" seems to perform the *"word" search (though it says it's performing the "word" search.
Unable Posted July 28, 2003 Posted July 28, 2003 I'm not sure what you have tried. It really is helpful to see your code. Did you try: <input type="hidden" name="-Op" value="cn"> <input type="text" name="yourfieldname" value=""> I believe that if you try that and through your browser enter into the text field the string SP (you can also try an entry of "SP", but I believe the quotes will be a hinderance) and then do a "Modify Last Find" in your db file, you will find that the data string from the CDML upon which the find operates will appear in the search field as *SP*. Best of luck.
ricardito Posted July 29, 2003 Author Posted July 29, 2003 Yes, the "cn" works. What I'm saying is that it's not clear in the CDML reference. If I am in the database itself and enter a find of "sp" it will return only words that start with "sp" but will not show it within a word, so if the field contains "I hate spam" it will return 1 found record and not "You inspire me" for instance. However if I use an asterisk (*"sp") then it will show all instances of "sp", both "I hate spam" and "You inspire me". The CDML reference says "cn" will return "word" (sp in this case) but in fact it will return *"sp" (with the asterisk). So my original post was inquiring about combining the asterisk and "" since I took the CDML at it's word. Thanks for the help. R
Unable Posted July 29, 2003 Posted July 29, 2003 "...my original post was inquiring about combining the asterisk and ""..." Ah. In the database when performing a find, under symbols one will find Literal, in which quotes are placed around a search string. In a db find if one places an asterisk on both sides of a search string it acts as a "contains". In the db, it is possible to enter both a contains and a literal (*"sp"*) around a search string. Quite frankly, the literal in such a combined symbols find will not return any more or less records than a "contains" find performed without the literal, In a web solution there is no value Literal of which I am aware, and no way to enter the quotes of a Literal around a search string except for the client to do so manually.
Recommended Posts
This topic is 7864 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now