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
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
makes it work.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted