GetDidYouMean

Vote:
 

Hi Friends

I want to implement GetDidYouMean with size attribute. Can you provide me with a sample code?

Syntax: GetDidYouMean(string query,Action)

#152314
Aug 23, 2016 22:09
Vote:
 

Hi,

here is an example:

SearchClient.Instance.Statistics().GetDidYouMean("hi there", x => x.Size = 10);

You can also use:

 SearchClient.Instance.Statistics().DidYouMean("hi there", 10);
#152317
Edited, Aug 24, 2016 7:52
Vote:
 

Thanks Magne... "GetDidYouMean" works...  

Initially I used "DidYouMean" and it always returns 0 results for me, i even updated latest FIND DLL. Its ok.. I will use "GetDidYouMean"

If possible can you tell me the differance between "GetDidYouMean" and "StatisticsDidYouMean" ?

#152488
Edited, Aug 24, 2016 15:20
Vote:
 

StatisticDidYouMean is just a wrapper for DidYouMean, with the default tags set and size set to 1:

    public static DidYouMeanResult StatisticsDidYouMean(this IStatisticsClient client, string query, int size = 1, IEnumerable<string> tags = null)
    {
      return client.GetDidYouMean(query, (Action<DidYouMeanCommand>) (x =>
      {
        x.Size = new int?(size);
        x.Tags = StatisticsClientExtensions.AddDefaultTags(tags);
      }));
    }
#152548
Aug 25, 2016 8:20
Vote:
 

Thanks a lot Magne.

#152587
Aug 25, 2016 16:02
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.