Google groups response from Oren. "...it isn't supported currently"
Error when getting "Suggestions" from ShardedDocumentStore: "You cannot get database commands for this query"
Domanda
I recently started using a sharded document store in my project. Going back through some old functionality that was working I am now getting an error. Wondering if getting suggestions across a sharded data store is not supported yet? Getting error "You cannot get database commands for this query" when calling "Suggest". Not sure what else to try at this point.
using (var session = Store.OpenSession())
{
var query = session.Query<Item>("ItemIndex").Statistics(out stats)
.Search(x => x.Title, searchCriteria.Title)
.Where(x => x.ItemZip.In(zipcodes))
.Skip(pageNumber * 40)
.Take(40); // Take posts in the page size
toReturn = query.ToList();
if (toReturn.Count() == 0)
{
var results = query.Suggest(new SuggestionQuery()//<---- error here
{
Field = "Title",
Term = searchCriteria.Title,
MaxSuggestions = 1,
Accuracy = 0.4f,
Popularity = true,
}).Suggestions;
if (results.Count() > 0)
{
searchCriteria.AlternateSearch = results[0];
}
}
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow