File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,20 @@ public interface ISearchFactoryImplementor : ISearchFactory
25
25
26
26
IFilterCachingStrategy GetFilterCachingStrategy ( ) ;
27
27
28
- FilterDef GetFilterDefinition ( string name ) ;
29
-
30
28
LuceneIndexingParameters GetIndexingParameters ( IDirectoryProvider provider ) ;
31
29
32
30
void AddIndexingParameters ( IDirectoryProvider provider , LuceneIndexingParameters indexingParameters ) ;
33
31
34
32
void Close ( ) ;
33
+
34
+ /// <summary>
35
+ /// Adds a FilterDef object to the ISearchFactory implementation with the given name.
36
+ /// In most cases, FilterDefs should be added during mapping configuration in a
37
+ /// custom ISearchMapping implementation. This method enables FilterDefs to be added
38
+ /// after mapping at run-time anytime an IFullTextSession is available.
39
+ /// </summary>
40
+ /// <param name="name"></param>
41
+ /// <param name="filter"></param>
42
+ void AddFilterDefinition ( string name , FilterDef filter ) ;
35
43
}
36
44
}
Original file line number Diff line number Diff line change
1
+ using NHibernate . Search . Engine ;
1
2
using NHibernate . Search . Reader ;
2
3
using NHibernate . Search . Store ;
3
4
@@ -35,5 +36,22 @@ public interface ISearchFactory
35
36
/// </summary>
36
37
/// <param name="entityType"></param>
37
38
void Optimize ( System . Type entityType ) ;
39
+
40
+ /// <summary>
41
+ /// Gets a FilterDef object by name from the ISearchFactory implementation.
42
+ /// A return value indicates if a matching FilterDef was found
43
+ /// </summary>
44
+ /// <param name="name"></param>
45
+ /// <param name="filter"></param>
46
+ /// <returns>True/false whether or not a FilterDef exists for the name.</returns>
47
+ bool TryGetFilterDefinition ( string name , out FilterDef filter ) ;
48
+
49
+ /// <summary>
50
+ /// Gets a FilterDef object by name from the ISearchFactory implementation.
51
+ /// Throws an exception if one does not exist.
52
+ /// </summary>
53
+ /// <param name="name"></param>
54
+ /// <returns>A FilterDef object associated with the included name parameter.</returns>
55
+ FilterDef GetFilterDefinition ( string name ) ;
38
56
}
39
57
}
Original file line number Diff line number Diff line change @@ -288,11 +288,21 @@ public void RegisterDirectoryProviderForLocks(IDirectoryProvider provider)
288
288
}
289
289
}
290
290
291
+ public bool TryGetFilterDefinition ( string name , out FilterDef filter )
292
+ {
293
+ return filterDefinitions . TryGetValue ( name , out filter ) ;
294
+ }
295
+
291
296
public FilterDef GetFilterDefinition ( string name )
292
297
{
293
298
return filterDefinitions [ name ] ;
294
299
}
295
300
301
+ public void AddFilterDefinition ( string name , FilterDef filter )
302
+ {
303
+ filterDefinitions . Add ( name , filter ) ;
304
+ }
305
+
296
306
public IOptimizerStrategy GetOptimizerStrategy ( IDirectoryProvider provider )
297
307
{
298
308
return dirProviderOptimizerStrategy [ provider ] ;
You can’t perform that action at this time.
0 commit comments