Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SharedHeader.h:57:10: fatal error: 'cstddef' file not found #30

Open
SureshBalusu opened this issue Jul 20, 2019 · 3 comments
Open

SharedHeader.h:57:10: fatal error: 'cstddef' file not found #30

SureshBalusu opened this issue Jul 20, 2019 · 3 comments

Comments

@SureshBalusu
Copy link

Unable to build project, used pod BRFullTextSearch. Please let me know how to proceed further

@SureshBalusu
Copy link
Author

SureshBalusu commented Jul 22, 2019

Solved by using s.dependency "BRFullTextSearch", "~> 2.0.0-beta1" in pod spec
But getting below error "libc++abi.dylib: terminating with uncaught exception of type CLuceneError"

Below is the snippet
NSFileManager *filemgr = [NSFileManager defaultManager];
NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
NSArray *dirContents = [filemgr contentsOfDirectoryAtPath:bundleRoot error:nil];
NSPredicate *fltr = [NSPredicate predicateWithFormat:@"self ENDSWITH '.html'"];
NSArray *htmlFileNames = [dirContents filteredArrayUsingPredicate:fltr];
// NSLog(@"htmls is %@", htmlFileNames);

NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"act005008"];
id<BRSearchService> service = [[CLuceneSearchService alloc] initWithIndexPath:path];
NSLog(@"%@", [NSDate date]);
for (NSString *fileName in htmlFileNames) {
    NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:[NSString stringWithFormat:@"/%@", fileName]];
    NSString *html = [[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
    // add a document to the index
    id<BRIndexable> doc = [[BRSimpleIndexable alloc] initWithIdentifier:fileName data:@{
                                                                                        kBRSearchFieldNameValue : html
                                                                                        }];
    NSError *error = nil;
    [service addObjectToIndexAndWait:doc error:&error];
    
}
NSLog(@"%@", [NSDate date]);
// search for documents and log contents of each result
id<BRSearchResults> results = [service search:@"Julien OR (Tiron AND width=device12345-width)"];
[results iterateWithBlock:^(NSUInteger index, id<BRSearchResult>result, BOOL *stop) {
    NSLog(@"Found result: %@", [[result dictionaryRepresentation] valueForKey:@"id"]);
}];

Where as above snippet working in SampleCocoaPodsProject which is taken from master github

@msqr
Copy link
Contributor

msqr commented Jul 22, 2019

I'm glad you made some progress using the 2.0 beta. I can't quite tell what your actual issue is, you might want to catch C++ exceptions in the debugger and see what's going on.

I'm not sure if it is related to you issue, but I notice you are indexing full HTML strings, which means HTML tags will most likely end up in your index as well, which might not be what you want. I think often you would extract just the text from the HTML and index that, breaking the text into different index fields as needed if you want to differentiate between text in different parts of the HTML, e.g. a title value vs something from the body.

@SureshBalusu
Copy link
Author

SureshBalusu commented Jul 22, 2019

I'm glad you made some progress using the 2.0 beta. I can't quite tell what your actual issue is, you might want to catch C++ exceptions in the debugger and see what's going on.

I'm not sure if it is related to you issue, but I notice you are indexing full HTML strings, which means HTML tags will most likely end up in your index as well, which might not be what you want. I think often you would extract just the text from the HTML and index that, breaking the text into different index fields as needed if you want to differentiate between text in different parts of the HTML, e.g. a title value vs something from the body.

But when I run the same in sample "SampleCocoaPodsProject" it was working fine. If I want to use the same pod how do I integrate it & what are the things that needs to be updated in pod file or podspec file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants