helmut_f Posted March 5, 2001 Posted March 5, 2001 hi! i would like to refine a search result by doing a new search on the results i've already got. i hope there is a way of doing so because that's the only way - as far as i can see - to do a complex search using AND and OR operators. (main search with AND, refining with OR) greetings, helmut ps: i'm sorry for my poor english.
Keith M. Davie Posted March 5, 2001 Posted March 5, 2001 How many fields are you searching to achieve your goal? Is there a particular order of search, eg. hair color first, height second, weight third? A little more info would be helpful. Peace Keith M. Davie
helmut_f Posted March 5, 2001 Author Posted March 5, 2001 thanks for answering so fast. it's a database for youth accomodation. the first criteria is the price of the accomodation (lower bound and upperbound for price, ie. gte lowerbound AND lte upperbound) and the amount of beds in the accomodation. this one ist easy. --- <input type="hidden" name="-Op" value="lte"> <input type="text" name="price" value="" size=10> <input type="hidden" name="-Op" value="gte"> <input type="text" name="price" value="" size=10> <input type="hidden" name="-Op" value="lte"> <input type="text" name="beds" value="" size=10> <input type="hidden" name="-Op" value="gte"> <input type="text" name="beds" value="" size=10> <input TYPE="submit" NAME="-find" VALUE="search"> --- next i want to refine the search for the area of the accomodation. ie. the user should be able to choose (for example) Region1 OR Region3 on the resultpage. this one is easy too, if it's done on the whole database but i'd like to do the second search not on the whole database but on the dataset selected in the first search. is this precise enough? bye, helmut
helmut_f Posted March 5, 2001 Author Posted March 5, 2001 really? i scrolled through this forum and found only "the use of AND and OR together is impossible with CDML". as i understand, you can use LOP to switch between AND and OR only for a whole query, not for parts in it.
Anatoli Posted March 6, 2001 Posted March 6, 2001 You can search in 100 fields and FM is treating that as simple AND. So price between AND location AND evening AND name AND ...
helmut_f Posted March 6, 2001 Author Posted March 6, 2001 quote: Originally posted by Anatoli: You can search in 100 fields and FM is treating that as simple AND. So price between AND location AND evening AND name AND ... --- yep, but i need an (price gte 1) AND (price lte 100) AND ((area eq region1) OR (area eq region 3)) or a way of doing a search on a selected dataset. is this possible or not?
Anatoli Posted March 6, 2001 Posted March 6, 2001 quote: Originally posted by helmut_f: --- yep, but i need an (price gte 1) AND (price lte 100) AND ((area eq region1) OR (area eq region 3)) or a way of doing a search on a selected dataset. is this possible or not? I doubt that "way of doing a search on a selected dataset." will be possible. Did you tried the areas entered into the same field?
helmut_f Posted March 6, 2001 Author Posted March 6, 2001 quote: Originally posted by Anatoli: Did you tried the areas entered into the same field? --- i do not understand. every accomodation is part of exactly ONE area. so there will never be more areas in one field. or do you mean: <input type="hidden" name="-Op" value="eq"> <input type="text" name="price" value="region1 region2" size=10>
Keith M. Davie Posted March 8, 2001 Posted March 8, 2001 It would be nice to find work. I have noticed that many people confuse pop-up menus on the web with pop-up menus in their db files, and the same is true of checkboxes. They operate differently. Similarly I find that many people have a real desire to use the -operators and -lops on their format files. These operators (lte, gte, eq, etc) generally work fine in [fmp-if] conditionals, otherwise it is probably not necessary to use these operators with the -lop tag. In fact, they probably won't work judging from the comments posted on these forums. The situation here is one example. As they would say at Apple, "Think different". I have written a form code for you. You can alter the names of the -db file and the -format file, and you can change the names of the fields to those you are using, but I have tried to use your terms. Try this: <p><center> <form action="fmpro" method="post"> <input type="hidden" name="-db" value="db.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="found.htm"> Low <select name="price"> <option value="5"> $5.00 <option value="10"> $10.00 <option value="15"> $15.00 <option value="20"> $20.00 <option value="25"> $25.00 <option value="30"> $30.00 </select> <input type="hidden" name="cost" value="..."> High <select name="beds"> <option value="1"> 1 <option value="2"> 2 <option value="3"> 3 <option value="4"> 4 <option value="5"> 5 <option value="6"> 6 </select> Region <select name="id"> <option value="R1"> Region 1 <option value="R2"> Region 2 <option value="R3"> Region 3 </select> <input type="submit" name="-find" value="find range"> </center> </form> You must understand that the field "price" could contain an amount $12.50 which would be found using this range-find technique when 10 and 15 were entered. Add whatever tokens are necessary. You will need to figure out what it is you desire to display on your results page (found.htm). Peace Keith M. Davie
helmut_f Posted March 10, 2001 Author Posted March 10, 2001 hu, i did'nt get the meaning of the findrange line. what field should "cost" be? how do you put the range in it? if i replace "cost" with "price", i get my whole database in return. beside: the range of the price is'nt my problem, it's the "range" of the areas. but how do you define ranges between countries? you cannot sort them by natural numbers because the surface of our earth is not one-dimensional but two-dimensional. but it would be nice to get your code work. so what is intended with "cost"? thank you for your work and fast replies, helmut
Keith M. Davie Posted March 10, 2001 Posted March 10, 2001 I apologize. In my rush to get this posted I didn't check things closely enough and so not everything was there, and some of what was there was in error. Try this: <p><center> <form action="fmpro" method="post"> <input type="hidden" name="-db" value="db.fp5"> <input type="hidden" name="-lay" value="web"> <input type="hidden" name="-format" value="found.htm"> <input type="hidden" name="-error" value="wrong.htm" Low <select name="price"> <option value="5"> $5.00 <option value="10"> $10.00 <option value="15"> $15.00 <option value="20"> $20.00 <option value="25"> $25.00 <option value="30"> $30.00 </select> <input type="hidden" name="price" value="..."> <!--three things are being entered into field "price", they are a "low" price, the range operator "...", and the "high" price.--> High <select name="price"> <option value="5"> $5.00 <option value="10"> $10.00 <option value="15"> $15.00 <option value="20"> $20.00 <option value="25"> $25.00 <option value="30"> $30.00 </select> No. Of Beds <select name="beds"> <option value="1"> 1 <option value="2"> 2 <option value="3"> 3 <option value="4"> 4 <option value="5"> 5 <option value="6"> 6 </select> Region <select name="id"> <option value="R1"> Region 1 <option value="R2"> Region 2 <option value="R3"> Region 3 </select> <input type="submit" name="-find" value="find these"> </center> </form> I hope you find this more useful. >"beside: the range of the price is'nt my problem, it's the "range" of the areas." < Yes I can see where that would be a problem. You either will need to define the regions such that they can be defined mathematically in your db, or you will need to resign yourself to the possibility that more than one search will be necessary. Peace Keith
Recommended Posts
This topic is 8727 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