Now that you have setup your WordPress search using WPSolr, you could also be interested in learning how to add Ajax search aswell.
Setup WPSolr WordPress search
Learn how to setup WordPress search using WPSolr.
Setup WPSolr Ajax search
Click on the “2.3 Suggestions” tab from thr WPSolr dashboard.
Create a new suggestion (Ajax search) by clicking on the “Configure new suggestions” button.
Activate the new suggestion by toggling “Is active”.
Rename the Ajax search to easily differentiate it from others (you can have as many as you want).
Set the “CSS selector” to ‘input[type=”search”]’. This is to select which input fields (search bars) should display the suggestions.
You should also choose the correct query and template.
The query will determine which type of results should be returned : “suggest keywords” will autocomplete the sentence that the user is entering in the search bar whereas “Suggest content” will return specific items that match the terms entered in the search bar.
The template will determine the appearance of the results.
You could also want to choose how many results should be displayed. You could want set it to 20 results maximum.
You can now save your suggestion by clicking on the button.
You can now view your results in the selected search bar.