: I have about 20k text files, some very small, but some up to 300MB, and : would like to do text searching with highlighting. : : Imagine the text is the contents of your syslog. : : I would like to type in some terms, such as "error" and "mail", and have : Solr return the syslog lines with those terms PLUS two lines of context. : Pretty much just like Google's highlighting.
The devil is in the details. based on the description of your problem, i would not index each TXT file as a single document. instead i would index each *line* of each TXT file as a document, and in stored (but not indexed) fields i would be the extra lines of context for highlighting. but that assumes that the results you are interested in is matching *lines* and not matching *files* -- based on your syslog example that seems like what you want (ie: "find me log entries containing 'error' and mail" ... not "find me entire log files that contain at least one error and at leas one mention of mail, even if they have nothing to do with one another). if that's not your goal, then please provide a more precise example of your use case. -Hoss