Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

search with lasso


This topic is 8280 days old. Please don't post here. Open a new topic instead.

Recommended Posts

i have a description field on a search form. i try to match every word that is entered in this field with my item description in my FM file.

I want to split the description entered by the user in many individual keyword that i would search against my db. i would use an or operator.

that way i do not have to match the exact sentance that the user is using. i can find some of the words in his sentence.

i can split the string using javascript, but is it the best way to do it. doesn

Link to comment
Share on other sites

I could see using String_CountField to count the number of words and then iterating through a loop (LoopTo String_CountField). Within the loop, set a Var to String_GetField,and use the variable in an inline search, still within the loop. You could set the results of the inline search to a variable and build a return-separated list to return to the user.

Check these tags in the LDML reference database for syntax.

Tom

[email protected]

http://www.tgparker.com/filemaker

Link to comment
Share on other sites

The form_param works great, but disappears after the first time you use it on a response page. You could try a reuseform_param tag, but it is much simpler, like Scratch said, to simply set a variable to the form_param. You can then use the variable an unlimited number of times on the page. If I need to pass it on to yet another page, I will use Input type= hidden (or pass it in a URL string) and then pick it up as a form_param in the next page (and so on). I use this method exclusively instead of using tokens or cookies.

Link to comment
Share on other sites

[Variable_Set: 'user'='[Form_Param:'UserId']']

<form action="action.lasso" method="post" >

<input type="hidden" name="-Token.use" value="[variable:'user']">

</form>]

i cannot load the value of the form param in the variable. it is on the response page, that's where it is supposed to be right? and UserId is the name of my form text box.

(the variable:'user' is in parenthesis and not in brackets on my file. I always get an error expected end of tag but found: '] or the end of my variable_set tag

Link to comment
Share on other sites

sorry, please disregard my last code, here is the right one.

i get no error on this one, but my field does not get updated.

[loop: loopFrom=1, loopTo=(variable:'numberfields'), LoopIncrement=1]

[variable_set:'keywords'=(list_getItem:'keyword', Listindex=(loopCount))]

[inline: Database='Item_Available', Layout='WebAvailable', nothing]

[if: 'Description'==(variable:'keywords')]

[inline: Database='Item_Available', Layout='WebAvailable', 'match'=(Math_Add: (Field:'match'),1) , update]

[/inline]

[/if]

[/inline]

[/Loop]

Link to comment
Share on other sites

ok here is the final one.

everything works fine, except for the fact that i cannot write to my db field. must be something wrong in the update inline. I know nested inline tags are not passing all the values to eachother.

however it is the same db.

[loop: loopFrom=1, loopTo=(variable:'numberfields'), LoopIncrement=1]

[variable_set:'keywords'=(list_getItem:'keyword', Listindex=(loopCount))]

[inline: Database='Item_Available', Layout='WebAvailable', 'Item_Description'=(variable:'keywords'), search]

[found_count]

[records]

[field:'Item_Description']

[field:'Match']

[variable_set:'newmatch'=(math_add:(field:'match'),1)]

[inline: Database='Item_Available', Layout='WebAvailable', 'Match'=(variable:'newmatch'), update]

[/inline]

[/records]

[/inline]

[/Loop]

Link to comment
Share on other sites

how about putting a

RecordID=(RecordID_Value),

in your update inline

laugh.giflaugh.gif

NB

When testing put

[Error_CurrentError]

replacement tag between the opening and closing Inline tags......this can be very helpful when debugging.

In your case you should have got a no records found error or something like that

Of course you can always incorporate an if statement and includes to alert the user that a prolem has occured.

[inline:............]

[if: (Error_CurrentError)=='No Error']

(or)

[if: (Error_CurrentError, ErrorCode)=='0']

Do this....

[Else]

[include: 'error.lasso']

[/if]

[/inline]

[ February 07, 2002, 02:02 AM: Message edited by: scratchmalogicalwax ]

Link to comment
Share on other sites

This topic is 8280 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.