How to make users look for records in a published database in my site

I need to develop a search system by keywords or year number and that the page answers all the records of the collection that match that search. I have the collection placed on a page and it can be viewed completely, but I need to place a search box that returns only the records that are consulted

1 Like

Why not just use Wix Data Query and the eq function for searches that equal that search input.
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#eq

For keywords, then have a look at using contains function.
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#contains

Just make sure that you read the info with each function as some functions are case sensitive so case won’t find Case etc, whereas others are not.

The same with looking for numbers, your user input for the search will be of text type, so if you have used a dataset with the field type of number, then the search might not find it.

You would have to look at making your number field in your dataset as a text field so that the two can both use text, instead of one being of text type string and the other being of number value and not matching and not finding anything.

To change a number in code to a text type, then simply use toString.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString
https://www.w3schools.com/jsref/jsref_tostring_number.asp

To change a text string in code into a number value, then you need to use parseInt.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
https://www.w3schools.com/jsref/jsref_parseint.asp

thanks for your help. I will be try