photo

Thomas

shared this question
5 months ago

Employees Involved

photo

PIV Support

Admin

Statistics

9
Comments
1
Views

Relates to

Share

Tags

1
votes

searchtext includes results matching lat long

how can i exclude the latitude and longitude fields from being included in text search results?

index.php?searchtext=53075&action=searchresults

Add Comment

Comments (9)

photo Employee
1

Can you share a link to your search page?

photo
1

no it is a local installation.

listing field editor has:

latitude -> Field Type: Latitude

longitude -> Field Type: Longitude

Display On Search Result Page: no

Display on Search Page: no

trying to do a single search field like wordpress has. searchtext seams to be the equivalent for OR.

lets say someone entered a number like a zip code or a listing number into the search field it is returning results where none of the text/number fields contain said zip code or a listing number but the latitude or longitude would match:

43.558279

-87.9530757

photo
1

using OR version 3.3

photo Employee
1

I don't know anything about wordpress or its search logic, but in OR the "Text Search" (searchtext) option will search every listing field in OR as well as the listing Titles for the value you entered.

e.g.

index.php?searchtext=53075&action=searchresults

Would return all listings that contain the value 53075 in any of its listing fields or listing title.

photo
1

yes, but why is Longitude and Latitude included in that? shouldn't such values be excluded?

no one is going to want to get a listing result returned where part of gps coordinates matched.

photo Employee
1

Because Lat and Long are listing fields, and that search is intended to target ALL listing fields. That what a global search does.

Perhaps no one wants those fields included in your specific use case, but that does not change what a global text search is intended for. If you want to do a partial text match search against specific fields, that is a configurable option when setting a field to be searchable in the Listing Field Editor. So, if you want zip codes to be searchable set your zip code listing field to be searchable as a search type: "Partial Text Match" and then you can perform searches using partial or full zip codes that target your zip code field specifically.

photo
1

is there an other way to accomplish it without having separate inputs for each field?

photo Employee
1

Yes, you could create a custom input field and <form> separate from the one OR generates that sends the user-entered text to a custom add-on that you created that searches the listing database excludinbg any fields you don't want.

You mentioned wordpress. How exactly does it do what you are expecting when using a global text search?

photo
1

The API is pretty good Thomas, I think you'd be able to knock up an addon to search all fields excl lat/long pretty easily, or get a developer to do so for you.

Leave Comment

photo

Attach files...

The file must be a jpg, gif, png, bmp, ico, pdf, doc, rtf, txt, zip or rar no more than 20M