<commit_before># Fail fast

Fail fast feature use **indexed** and **stored** properties of **SolrFieldAttribute** to validate use of fiels and throws exceptions if a not allowed use has made.

To use this feature, follow bellow steps:

1. Active featue in SolrOptions (actived by default):

'''
    // Also, you can use ConfigueOptions
    var options = new DocumentCollectionOptions
    {
        FailFast = true // <-- This make the magic happens
    };
'''

2. Configure SolrFieldAttribute

```
public class TechProductDocument : IDocument
{
    [SolrFieldAttribute("some_field1", Indexed = false, Stored = true)]
    public string SomeField1 { get; set; }

    [SolrFieldAttribute("some_field2", Indexed = true, Stored = false)]
    public string SomeField2 { get; set; }
}
```

Now, some things will occur when use **SomeField**, see bellow:

|Use case|Using method   |SomeField1      |SomeField2|
|--------|---------------|----------------|----------|
|Faceting|FacetQuery(...)|Throws exception|Works well|
|Faceting|FacetRange(...)|Throws exception|Works well|
|Faceting|FacetField(...)|Throws exception|Works well|
|Search  |Query(...)     |Throws exception|Works well|


**NOTE**

See more in **[field options by use case](http://wiki.apache.org/solr/FieldOptionsByUseCase)**;<commit_msg>Fail fast<commit_after># Fail fast

Fail fast feature use **indexed** and **stored** properties of **SolrFieldAttribute** to validate use of fiels and throws exceptions if a not allowed use has made.

To use this feature, follow bellow steps:

1. Active featue in SolrOptions (actived by default):

'''
    // Also, you can use ConfigueOptions
    var options = new DocumentCollectionOptions
    {
        FailFast = true // <-- This make the magic happens
    };
'''

2. Configure SolrFieldAttribute

```
public class TechProductDocument : IDocument
{
    [SolrFieldAttribute("some_field1", Indexed = false, Stored = true)]
    public string SomeField1 { get; set; }

    [SolrFieldAttribute("some_field2", Indexed = true, Stored = false)]
    public string SomeField2 { get; set; }
}
```

Now, some things will occur when use **SomeField**, see bellow:

|Use case     |Using method      |SomeField1      |SomeField2|
|-------------|------------------|----------------|----------|
|Boosting     |Boost             |                |          |
|Faceting     |FacetField        |Throws exception|Works well|
|Faceting     |FacetQuery        |Throws exception|Works well|
|Faceting     |FacetRange        |Throws exception|Works well|
|Field list   |Fields            |                |          |
|Filtering    |Filter            |                |          |
|Geo filtering|SpatialFilter     |                |          |
|Search       |Query             |Throws exception|Works well|
|Search       |QueryField        |                |          |
|Should match |MinimumShouldMatch|                |          |
|Sorting      |Sort              |                |          |

**NOTE**

See more in **[field options by use case](http://wiki.apache.org/solr/FieldOptionsByUseCase)**;
{'fraction_non_alphanumeric': 0.14132553606237816, 'fraction_numerical': 0.005198180636777128, 'mean_word_length': 2.37980241492865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4909250', 'n_tokens_mistral': 887, 'n_tokens_neox': 842, 'n_words': 271}