<commit_before>FullTextSearch
==============

iOS Objective-C search engine.

This project provides a way to integrate full-text search capabilities
into your iOS project. First, it provides a protocol-based API for a 
simple search framework. Second, it provides a 
[CLucene](http://clucene.sourceforge.net/) based implementation of that
framework.

Example Usage
-------------

The following snippet shows how the API works. The `CLuceneSearchService`
reference is the only CLucene-specific portion of the code:

	id<BRSearchService> service = [[CLuceneSearchService alloc] initWithIndexPath:@"/some/path"];
	
	// add a document to the index
	id<BRIndexable> doc = [[BRSimpleIndexable alloc] initWithIdentifier:@"1" data:@{
						   kBRSearchFieldNameTitle : @"Special document",
						   kBRSearchFieldNameValue : @"This is a long winded note with really important details in it."
						   }];
	[service addObjectToIndexAndWait:doc];
	
	// search for documents and log contents of each result
	id<BRSearchResults> results = [service search:@"special"];
	[results iterateWithBlock:^(NSUInteger index, id<BRSearchResult>result, BOOL *stop) {
		NSLog(@"Found result: %@", [result dictionaryRepresentation]);
	}];

Project Setup
-------------

After cloning the BRFullTextSearch repository, you must initialize git submodules.
For example:

	git clone git@github.com:Blue-Rocket/BRFullTextSearch.git
	cd BRFullTextSearch
	git submodule update --init
	
This will pull in the relevant submodules, e.g. CLucene.

Static Framework Project Integration
------------------------------------

You can integrate BRFullTextSearch into your project in a couple of ways. First,
the BRFullTextSearch Xcode project includes a target called 
**BRFullTextSearch.framework** that builds a static library framework. Build 
that target, which will produce a `BRFullTextSearch.framework` bundle at 
the root project directory. Copy that framework into your project and add it
as a build dependency.

You must also add the following linker build dependencies, which you can do by
clicking the **+** button in the **Link Binary With Libraries** section of the 
**Build Phases** tab in the project settings:

 * libz
 * libstdc++

Finally, add `-ObjC` as an *Other Linker Flags* build setting.

The **SampleStaticLibraryProject** included in this repository is an example
project set up using the static library framework integration approach. You
must build **BRFullTextSearch.framework** first, then open this project. When
you run the project, it will index a set of documents using some Latin text.
You can then search for latin words using a simple UI.

Dependent Project Integration
-----------------------------

The other way you can integrate BRFullTextSearch into your project is to add
the BRFullTextSearch Xcode project as a dependent project of your project. The 
BRFullTextSearch Xcode project includes a target called <commit_msg>Add missing step about framework search path.<commit_after>FullTextSearch
==============

iOS Objective-C search engine.

This project provides a way to integrate full-text search capabilities
into your iOS project. First, it provides a protocol-based API for a 
simple search framework. Second, it provides a 
[CLucene](http://clucene.sourceforge.net/) based implementation of that
framework.

Example Usage
-------------

The following snippet shows how the API works. The `CLuceneSearchService`
reference is the only CLucene-specific portion of the code:

	id<BRSearchService> service = [[CLuceneSearchService alloc] initWithIndexPath:@"/some/path"];
	
	// add a document to the index
	id<BRIndexable> doc = [[BRSimpleIndexable alloc] initWithIdentifier:@"1" data:@{
						   kBRSearchFieldNameTitle : @"Special document",
						   kBRSearchFieldNameValue : @"This is a long winded note with really important details in it."
						   }];
	[service addObjectToIndexAndWait:doc];
	
	// search for documents and log contents of each result
	id<BRSearchResults> results = [service search:@"special"];
	[results iterateWithBlock:^(NSUInteger index, id<BRSearchResult>result, BOOL *stop) {
		NSLog(@"Found result: %@", [result dictionaryRepresentation]);
	}];

Project Setup
-------------

After cloning the BRFullTextSearch repository, you must initialize git submodules.
For example:

	git clone <EMAIL>:Blue-Rocket/BRFullTextSearch.git
	cd BRFullTextSearch
	git submodule update --init
	
This will pull in the relevant submodules, e.g. CLucene.

Static Framework Project Integration
------------------------------------

You can integrate BRFullTextSearch into your project in a couple of ways. First,
the BRFullTextSearch Xcode project includes a target called 
**BRFullTextSearch.framework** that builds a static library framework. Build 
that target, which will produce a `BRFullTextSearch.framework` bundle at 
the root project directory. Copy that framework into your project and add it
as a build dependency.

You must also add the following linker build dependencies, which you can do by
clicking the **+** button in the **Link Binary With Libraries** section of the 
**Build Phases** tab in the project settings:

 * libz
 * libstdc++

Next, add `-ObjC` as an *Other Linker Flags* build setting.

Finally, you'll need to add the path to the directory containing the 
`BRFullTextSearch.framework` bundle as a **Framework Search Paths** value
in the **Build Settings** tab of the project settings.

The **SampleStaticLibraryProject** included in this repository is an example
project set up using the static library framework integration approach. You
must build **BRFullTextSearch.framework** first, then open this project. When
you run the project, it will index a set of documents using some Latin text.
You can then search for latin words using a simple UI.

Dependent Project Integration
-----------------------------

The other way you can integrate BRFullTextSearch into your project is to add
the BRFullTextSearch Xcode project as a dependent project of your project. The 
BRFullTextSearch Xcode project includes a target called 
{'fraction_non_alphanumeric': 0.09713060686015831, 'fraction_numerical': 0.00032981530343007914, 'mean_word_length': 4.131133671742809, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1101597', 'n_tokens_mistral': 1608, 'n_tokens_neox': 1504, 'n_words': 725}