cancel
Showing results for 
Search instead for 
Did you mean: 

Wildcards in search

simon
Champ in-the-making
Champ in-the-making
Hi again,

Have a question concerning the search functionality.

1. First of all the 3 characters minimum is kind of annoying. What if I need all the documents for one specific author (defined in the more search options author field)? In this case I don't need to enter some other search sting…

2. What with the search wildcards? I would think I can use * and ? as wildcards as I would in an other search tool (Lucene has this). Problem is I don't really see how this will work in Alfresco. When I enter "somestr" Alfresco finds the document "somestring" but if I enter "somestr*" the document "somestring" doesn't show up.

Is this a configuration issue or a restriction in the current release (we use the enterprise 1.1.2 version)?

Update: When I try "*somestr*" the "somestring" document is found… don't get it.
16 REPLIES 16

kevinr
Star Contributor
Star Contributor
Hello,

1. The 3 character limit is configurable in web-client-config.xml. It is there to provide a "sane" limit for minimum searches - otherwise there is nothing to stop an excitable user searching for "*" or "a" and bringing back many 10000's of results. We do not yet have fixed size result sets in the repository (although it is in the pipeline) so this could be a problem on large repos if users try to search for "*" or similar.

We agree with your comments about just currently being able to search on say "author" and being forced to also enter a value in the main text field, so the restriction has been removed in the current build ready for the next release. You will be able to search on any or several of the attributes, including say just a search for all docs in category or all docs by author XYZ as you say.

2. By default the Alfresco web-client is appending a "*" to your search, so if you search for "somestr" it is finding "somestring" because the underlying search is actually "somestr*". You can prepend a "*" to your search to get wildcard matching on the stem of a term e.g. "*mestr" will find "somestring" and "homestreet". This is not the default again to improve the performance of default searches, as a *xyz* style match is the more expensive search in Lucene. We could make this configurable also if it's a problem for you.

Hope this helps,

Kevin

simon
Champ in-the-making
Champ in-the-making
Thanks Kevin!

1. I see why you implemented this restriction but it narrows the search possibilities. In my opinion it would be better to handle this in the underlying code: select the first 50 records and show a "next 50 results" or something similar. This wouldn't affect the performance (you don't need to fetch 1000 records) and the search would be more intuitive, no?

2. Appending a * by default is not a bad choice, it's what you would expect from a search engine but what if I enter "simestr*"? The system should detect this and remove my * from the search string, don't you think? So if I enter "simestr*", the system shouldn't search for "simestr**" but for "simestr*".

kevinr
Star Contributor
Star Contributor
Hi,

1. Indeed I agree. As I say we don't have limited resultsets yet in the repo which we'd need to do this. The performance issue is in the repo not the client (as the client only shows 10 or so things at once) but the repo does a lot of work if 10000+ objects are in the resultset, even if the client only wants to fetch 50 or similar - so it's definitely on the list!

2. True. I'll see if we can make that change. Basically at the moment, any "special" character is encoded so users can't break the search by entering garbage, so it just needs some more work to spot common wildcards etc.

You may also be interested to know that as well as the non-mandatory text field change I mention above, the following new code is available in the next release (or a recent nightly build):


r2126 | kevinr | 2006-01-17 13:36:18 +0000 (Tue, 17 Jan 2006) | 1 line
Changed paths:
   M /alfresco/HEAD/root/projects/web-client/source/java/org/alfresco/web/bean/SearchContext.java

Improvements to Simple and Advanced Search to add basic operator support
- you can now use AND "+" and NOT "-" operators when specifing multiple search terms (otherwise default is OR as previously)
- examples:
   house techno                 - finds items containing "house" or "techno" (default)
   house +techno                - finds items containing "house" and "techno"
   house +techno -trance        - finds items containing "house" and "techno" but not "trance"
- you can use the operators in the Simple Search or Advanced Search text field
- works for full text and file/space name fields

Thanks,

Kevin

simon
Champ in-the-making
Champ in-the-making
Great reply Kevin, thanks!

This what I needed to know. I'll give you guys some time do develop all these features and not only answering questions… Looking forward to the 1.2 release.

unknown-user
Champ on-the-rise
Champ on-the-rise
Hello,
         Well as mentioned that you are annoyed with 3 compulsory letters need to be enter for a search.But you can change the limitations for 3 letters to 1 or the number of characters of your own wish.
What you can do is when you install the Alfresco Labs 3B ,you get a particular folder structure so now browse
the path :- Alfresco Labs3\tomcat\webapps\alfresco\WEB-INF\classes\alfresco in this you will find a file named as web-client-config.xml inside this you can find a search minimum option as looks like below.You can change the number from 1 to number of characters you want to have as minimum in search.I hope this will work.

<!– the minimum number of characters required for a valid search string –>
         <search-minimum>1</search-minimum>

Smiley Happy

simon
Champ in-the-making
Champ in-the-making
Thanks for the heads up Chitral. It's good to see this is possible with configuration options today. At the time of the post (2 years ago) things looked a bit different.  :wink:

chims
Champ in-the-making
Champ in-the-making
Hello,
      Can anyone tell me that how to avoid the exact word search.I mean for e.g. If I search for a word Strut and in the document it is quoted as Struts so it doesnot give me any results.

Thanks Chims!!! Smiley Happy

kevinr
Star Contributor
Star Contributor
strut*
will find everyword that starts with "strut" such as "struts"
and for example
*ing
will find every word that ends with "ing" such as "testing"
you can also use * at both the start and the end of a word.

Cheers,

Kev

chims
Champ in-the-making
Champ in-the-making
Hi…
         Well thanks! Smiley Happy  I have already done with this but if in case of vice versa wht we need to do…I mean suppose I have search for a word Struts and in document it is Strut then what I need to do….As I cant search as Struts* it wont give any result.
It means that we need to be specific in our search that is we need to remeber what we have entered exactly,and I think its a difficult task…. :?

Thanks Chims!!! Smiley Happy