As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<property name="xxx:filename_property"> <description>Untokenised filename used by Lucene queries</description> <type>d:text</type> <mandatory>true</mandatory> <multiple>false</multiple> <index enabled="true"> <tokenised>false</tokenised> </index> </property>
I encountered the same issue. Only after understanding how Lucene indexes, will you find out that characters such as underscore, dashes, etc. are not included. One possible solution is to add a custom property on the node (of the content item) to capture the file name and tell Lucene not to tokenize this field. It would look as such: <property name="xxx:filename_property"> <description>Untokenised filename used by Lucene queries</description> <type>d:text</type> <mandatory>true</mandatory> <multiple>false</multiple> <index enabled="true"> <tokenised>false</tokenised> </index> </property> Please confirm if this works.
<index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>false</tokenised> </index>
Hi,Did you try this?<index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>false</tokenised> </index>When you create new content this will be applied. if you want it to be applied to the old content you'll have to reïndex alfresco.Thats what ive done. And it worked fine.Regards
<property name="cm:name"> <title>Name</title> <type>d:text</type> <mandatory enforced="true">true</mandatory> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>both</tokenised> </index> <constraints> <constraint ref="cm:filename" /> </constraints> </property>
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService(); // Create a query object, looking for all items with alfresco in the name of text Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:" + searchText + "\""); // Execute the query final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore"); QueryResult queryResult = repositoryService.query(STORE, query, false); // Display the results ResultSet resultSet = queryResult.getResultSet(); ResultSetRow[] rows = resultSet.getRows();
searchText
Hi,Can anyone help me out ..I am using web service to search a file in alfresco repository, here's the code: RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService(); // Create a query object, looking for all items with alfresco in the name of text Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:" + searchText + "\""); // Execute the query final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore"); QueryResult queryResult = repositoryService.query(STORE, query, false); // Display the results ResultSet resultSet = queryResult.getResultSet(); ResultSetRow[] rows = resultSet.getRows(); I am passing file name without extension as searchText for ex: Suppose i have two files File1.txt and file1.pdf and i want to search both the files just by passing file1 as my searchText I tried the same thing, query returns nothing. And when I tried searching as File1.txt, query returns the exact file.What could be the possible modification I should do with the above query to get my expected result.Any suggestion appreciatedThanks in advance
So, which alfresco version are you working with? In my Labs 3.0 the name field is declared with <tokenised>both</tokenised>, which should mean that both the single tokens and the complete name will be stored: <property name="cm:name"> <title>Name</title> <type>d:text</type> <mandatory enforced="true">true</mandatory> <index enabled="true"> <atomic>true</atomic> <stored>false</stored> <tokenised>both</tokenised> </index> <constraints> <constraint ref="cm:filename" /> </constraints> </property> May <tokenised>both</tokenised> solve your problem?Beside this i recognized a serious problem with indexing of 'd:text' and 'd:content' fields. In some cases (maybe during index merge processes) the index content is cuttened, so the creator admin will be cropped to "admi" in the index and will not be searchable with "admin" any longer! Currently I'm trying to get deeper into this.
Searches for files with underscores in the file name are currently unpredictable and returning no results in some cases……
<stored>true</stored><tokenised>both</tokenised>
Morgand,Regarding:Searches for files with underscores in the file name are currently unpredictable and returning no results in some cases……I found the behavior is quite predictable but wierd.If you have not already tried, should try this in your custom property "filename_property" :<stored>true</stored><tokenised>both</tokenised>This would let the fields be stored in the index and then look into the Lucene index with Luke - http://www.getopt.org/luke/That would give you an idea of how the fields are being tokenized and how you could search.I did the same and observed the following:1. test_name is tokenized as "test", "name"2. test_my_name is => "test", "my", "name"3. test_name10 is => "test_name10"4. test_my_name10 => "test", "my_name10"5. test_again_my_name10 => "test", "again", "my_name10"Haven't tried out test_10 still.
A) When choosing an index to load into luke, i look in ..\alfresco_data\alf_data\lucene-indexes\workspace\SpacesStore Why are there 5-10 different folders in there?
When i choose an index and in luke, look at the available fields I don't see filename, why not?