Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to setup spatial search, to get the nearest locations from another location, but I am having trouble getting out results.
The index looks fine and has data http://prntscr.com/itrup4
The search itself looks like this
var clientLatitude = 56.3354034; var clientlongitude = 8.651975; double KmsToMiles = 0.621371192; double _radius = 500 * KmsToMiles; LuceneIndexer indexer = (LuceneIndexer)ExamineManager.Instance.IndexProviderCollection["ClickAndCollectIndexer"]; IndexSearcher searcher = new IndexSearcher(indexer.GetLuceneDirectory(), false); BooleanQuery criteria = new BooleanQuery(); criteria.Add(new TermQuery(new Term("nodeTypeAlias", "clickandcollecttype")), BooleanClause.Occur.MUST); Lucene.Net.Search.Filter distanceFilter = new DistanceQueryBuilder((double)clientLatitude, (double)clientlongitude, Convert.ToDouble(_radius), "codedlat", "codedlong", CartesianTierPlotter.DefaltFieldPrefix, true).Filter; var results = searcher.Search(criteria, distanceFilter, searcher.MaxDoc());
Cannot seem to figure out where my problem is.
Found the answer to the problem.
Not having the tiers in the index config, but rather creating them as suggested by Ismail here
https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/89160-auto-index-examine-fields-from-custom-data-source-using-lucene-spatial-search#comment-281868
makes it work.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Lucene Spatial Search
I'm trying to setup spatial search, to get the nearest locations from another location, but I am having trouble getting out results.
The index looks fine and has data http://prntscr.com/itrup4
The search itself looks like this
Cannot seem to figure out where my problem is.
Found the answer to the problem.
Not having the tiers in the index config, but rather creating them as suggested by Ismail here
https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/89160-auto-index-examine-fields-from-custom-data-source-using-lucene-spatial-search#comment-281868
makes it work.
is working on a reply...