Developer forum

Forum » Swift » Two different query parameter names for Swift_SearchField and typeahead

Two different query parameter names for Swift_SearchField and typeahead

Mikkel Hammer
Mikkel Hammer
Reply

Hi DW,

Is it intended that Swift_SearchField and the typeahead suggestions in the search use two different names for the query parameter?
It forces you to check on two different parameters in your Product.query

Swift_SearchField uses "q=" when you submit the form,
and the typeahead uses "eq=" when typing the in input field in the form

I've attached a picture below showing the files.

Best regards,
Mikkel Hammer

search_parameters.png

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Yes that is on purpose.

This is to make it possible to control what suggestions are available in the type ahead. The suggestions are nearest terms from one field only and that is what eq targets. The eq parameter is looking in a summary field that only contains data from the fields that you want suggestions from. It is also seperated because some of your fields for q parameter might be analyzed others not, which will be problematic for suggestions.

Votes for this answer: 1
 
Mikkel Hammer
Mikkel Hammer
Reply

Hi Nicolai,

That makes sense! Thanks a lot for the explanation

Best regards,
Mikkel Hammer

 

You must be logged in to post in the forum