SolrNet interrogazione assistenza e alcune opzioni di debug
-
26-10-2019 - |
Domanda
Come potrei usare SolrNet per eseguire una query SUPERIORE A / MENO?
Esempio:
I miei documenti hanno un campo chiamato "minimumDays" e ho solo voglia di tornare documenti in cui quel campo è inferiore o uguale al numero di passo nella query.
Al momento ho questo, ma non sono sicuro che sia corretta.
int requestedDays = 3;
var minimumNightsQuery = new SolrQueryByRange<int>("minimumDays", 0, requestedDays, true);
Sono sulla strada giusta?
La seconda parte qui è se c'è qualche modo per capire meglio la query che viene passata in Solr da SolrNet? Debug valore o qualcosa in cui posso controllare la variabile "q", per esempio.
Grazie ancora per il vostro aiuto
Soluzione
You can use SolrQueryByRange for the first part of your question. Your code does look good. debugging your query and results might help. I have found that SolrNet does some odd things. - http://code.google.com/p/solrnet/wiki/Facets#Arbitrary_facet_queries
For the second part, You can intercept the ISolrConnection and put in your own in between. For a good start check this out: http://code.google.com/p/solrnet/source/browse/trunk/SampleSolrApp/LoggingConnection.cs?r=513 I have one that logs the query and the results, and if a config setting is on it appends the debug param and logs that result also. Its great info to have.... and one of the only ways to get it.