Try our conversational search powered by Generative AI!

Star och empty-search with UnifiedSearch

Vote:
 

We are using both standard .Search and .UnifiedSearch and when whe use .Search and pass in "*" or "" in "For" we get all results but when we do it in .UnifiedSearch we get no result. Do we pass in some text in .UnifiedSearch we get results so I woundering if there is not possible to do "star-search" with .UnifiedSearch?
Or am I doing it wrong?

 

/Henrik

#75205
Sep 20, 2013 11:10
Vote:
 

Hey Henrik,

UnifiedSearch uses stemming in the language that you have provided, or in the users current language when using the CMS integration. Therefor, can you try and see what happens if you add a language when using the ordinary Search method (ie .Search<T>(Language.Swahili))?

#75243
Sep 23, 2013 14:56
Vote:
 

Joel. I use the "dummy"-client for my search (var client = createfromconfig.,.) and I already set a language in my unifiedsearch but do you mean the other search where it works to search for star or empty string?

#75297
Sep 24, 2013 14:09
Vote:
 

Yeah, just to get a realistic comparison

#75298
Sep 24, 2013 14:12
Vote:
 

Something is strange with my unified search. I tried this as you said Joel:

var searchResult = client.Search<Jobbannons>(Language.Swedish).For("*").GetResult(); (Zero result)
var searchResult1 = client.Search<Jobbannons>(Language.Swedish).For("").GetResult(); (530 results)

I have four versioning files in my index and when I explore the index with a term inside the pdf I got this result:
Utforska IndexHelp

   Stödjer Lucene söksyntax

 


Knowing that I did four different simple Unified searches:

var searchResult = client.UnifiedSearchFor("*", Language.Swedish).GetResult();
var searchResult2 = client.UnifiedSearchFor("", Language.Swedish).GetResult();
var searchResult3 = client.UnifiedSearchFor("modifying", Language.Swedish).GetResult();
var searchResult4 = client.UnifiedSearchFor("modifying", Language.English).GetResult();

They ALL end up with zero result, the two last one searching for the same term as I did when I explored the index.

/Henrik

 

#75495
Sep 27, 2013 7:49
Vote:
 

Ok, new info.

I tried to move the search-queries back to the web project and do the same test with the CMS-integration, buildning a extremly simple .aspx page like this:

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="EPiServer.Find" %>
<%@ Import Namespace="EPiServer.Find.Cms" %>
<%@ Import Namespace="EPiServer.Find.Framework" %>
<%@ Import Namespace="EPiServer.Web.Hosting" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<div>
<h1>EpiFind-test</h1>

FileSearch:<br/>
<%
var result = SearchClient.Instance.Search<UnifiedFile>().For("modifying").GetFilesResult();

Response.Write("ResultCount: " + result.TotalMatching);

%>
<br/><br/><br/>
UniFiedSearch:<br/>
<%
var searchResult3 = SearchClient.Instance.UnifiedSearchFor("modifying").GetResult();
Response.Write("ResultCount: " + searchResult3.TotalMatching);
%>
<br/><br/><br/>

UniFiedSearch ALL:<br/>
<%
var searchResult4 = SearchClient.Instance.UnifiedSearchFor("").GetResult();
Response.Write("ResultCount: " + searchResult4.TotalMatching);
%>
</div>
</body>
</html>

To my supprise there it worked!

The result was 1 hit for the query with the text "modifying" both with unified search and with fileresult

And 15 hits for unified search with empty text.

 

I am not happy with that, since we do want to have the searching as a help class so what do the CMS integration do, that the client does not?

 

 

#75496
Sep 27, 2013 8:16
Vote:
 

More detail:

SearchClient.Instance.UnifiedSearchFor("modifying", Language.Swedish).GetResult(); (One result)

var client = Client.CreateFromConfig();
client.UnifiedSearchFor("modifying", Language.Swedish).GetResult(); (No results)

So with the same language it's differ.....

/Henrik

#75497
Sep 27, 2013 8:27
Vote:
 

That is most likely because you are using different clients. 

SearchClient.Instance have a lot of conventions that is set up on initialization for unifiedsearch(Part of the find.cms init). So you need to do similar setup in you client.

#75502
Sep 27, 2013 8:53
Vote:
 

Thanks Marcus, I was thinking in that direction so now it's time for some digging to see what it does

#75503
Sep 27, 2013 8:56
Vote:
 

Yes reflecting might be the easiest way to find out

 

#75505
Sep 27, 2013 9:07
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.