# After importing the document into Weaviate for a period of time, it cannot be searched using BM25,

**URL:** https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648
**Category:** Support
**Tags:** bug
**Created:** [September 11, 2023, 5:58am UTC](https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648 "2023-09-11T05:58:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![codehelen](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/codehelen/32/359_2.png) [@codehelen](https://forum.weaviate.io/u/codehelen)
#### Post date: [September 11, 2023, 5:58am UTC](https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648/1 "2023-09-11T05:58:25Z")

</div>

hi , I found this issue while using Weaviate，It’s normal for me to search immediately after importing，At that time, a few hours later, I found it impossible to search for this document using BM25。I’m sure I haven’t done anything else with Weaviate，But I can search for this document using a filter，Alternatively, using embedding can also be searched for。

I don’t know where the problem is. Can someone help me? Thank you very much

---

<div class="post-metadata">

### Author: ![codehelen](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/codehelen/32/359_2.png) [@codehelen](https://forum.weaviate.io/u/codehelen)
#### Post date: [September 11, 2023, 6:07am UTC](https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648/2 "2023-09-11T06:07:07Z")

</div>

The definition of the search field is:

```auto
Property.builder().name("doc_name_analyzed").dataType(Arrays.asList(DataType.TEXT)).tokenization(Tokenization.WHITESPACE).build(),

```

the doc content:

```auto
{"gmt_create":"2023-09-04T07:19:34Z","modify_user_name":"yifeng","tenant_id":"7502","create_user_id":"8752","modify_status":3.0,"create_user_name":"yifeng","doc_name_analyzed":"19file _ partag 的 副本","knowledge_type":3.0,"doc_start_date":"1979-12-31T16:00:00Z","doc_type":"doc","gmt_modified":"2023-09-11T03:11:57Z","doc_id":"424","uuid":"doc-424","url":"doc2bot/docmind/7502/19file_partag的副本_1693811991175.txt","doc_end_date":"1979-12-31T16:00:00Z","doc_name":"19file_partag的副本.txt","doc_status":20.0,"process_status":0.0,"_additional":{"id":"65b79a7a-2708-4eb7-8adc-f84a96c127d6"},"cat_code":"231001001629","cat_path":["-1","231001001629"],"modify_user_id":"8752"}

```

this is my test code

```auto
    @Test
    public void testBm25Search() {

        Result<GraphQLResponse> run = client.graphQL()
                .get()
                .withClassName("Bge768_sandbox_doc2bot")
                .withFields(
                        Field.builder().name("doc_id").build()

                )
                .withBm25(Bm25Argument
                        .builder()
                        .properties(new String[]{"doc_name_analyzed"})
                        .query("副本")
                        .build()
                )
                .withWhere(
                        WhereArgument.builder().filter(
                                WhereFilter.builder()
                                        .operator(Operator.And)
                                        .operands(new WhereFilter[]{
                                                WhereFilter.builder()
                                                        .path("tenant_id")
                                                        .operator(Operator.Equal)
                                                        .valueText("7502").build(),
                                                WhereFilter.builder()
                                                        .path("doc_type")
                                                        .operator(Operator.Equal)
                                                        .valueText("doc").build()
                                        })
                                        .build()
                        ).build()
                )
                .withLimit(2000)
                .run();
        System.out.println(JSON.toJSONString(run));
    }

```

---

<div class="post-metadata">

### Author: ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)
#### Post date: [September 20, 2023, 5:16pm UTC](https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648/3 "2023-09-20T17:16:40Z")

</div>

Hi! Maybe you have found this bug?

> <https://github.com/weaviate/weaviate/issues/3517>
>
> Hi –
> 
> I have an \*\*Article\*\* class, which contains many french legal articles.
> …
> 
> Here is the class initiation : 
> \`\`\`
> class\_obj = {
> "class": "Article",
> "description": "Articles des différentes codes de la loi.",
> "invertedIndexConfig": {
> "stopwords": {
> "preset": "none",
> #"additions": stopwords\_fr
> }
> },
> "vectorizer": "text2vec-transformers",
> "properties": \[
> {
> "name": "article\_id",
> "description": "Id unique de l'article.",
> "dataType": \[
> "text"
> \],
> "indexFilterable": True,
> "indexSearchable": False, 
> },
> {
> "name": "source",
> "description": "Titre de la source juridique (code, loi ou ordonnance) contenant l'article.",
> "dataType": \[
> "text"
> \],
> "tokenization": "lowercase",
> "indexFilterable": True,
> "indexSearchable": True, 
> },
> {
> "name": "titre",
> "description": "Le titre de l'article.",
> "dataType": \[
> "text"
> \],
> "indexFilterable": True,
> "indexSearchable": True, 
> "tokenization": "lowercase"
> },
> {
> "name": "texte",
> "description": "Le texte de l'article, en html.",
> "dataType": \[
> "text"
> \],
> "moduleConfig": {
> "text2vec-transformers": {
> "skip": False,
> "vectorizePropertyName": False
> }
> },
> "indexFilterable": True,
> "indexSearchable": True, 
> },
> {
> "name": "etat",
> "description": "Etat de l'article : en vigueur, abrogé...",
> "dataType": \[
> "text"
> \],
> "indexFilterable": True,
> "indexSearchable": False, 
> },
> {
> "name": "path\_title",
> "description": "Chemin daccès à l'article",
> "dataType": \[
> "text\[\]"
> \],
> "indexFilterable": True,
> "indexSearchable": True, 
> },
> {
> "name": "ref\_textes",
> "description": "Références avec d'autres textes.",
> "dataType": \[
> "text"
> \],
> "indexFilterable": True,
> "indexSearchable": False, 
> },
> {
> "name": "order",
> "description": "Ordre de l'article dans le code.",
> "dataType": \[
> "int"
> \],
> "indexFilterable": True,
> "indexSearchable": False,
> },
> {
> "name": "date\_deb",
> "description": "Date de début de l'article.",
> "dataType": \[
> "int"
> \],
> "indexFilterable": True,
> "indexSearchable": False,
> },
> {
> "name": "date\_fin",
> "description": "Date de fin de l'article.",
> "dataType": \[
> "int"
> \],
> "indexFilterable": True,
> "indexSearchable": False,
> },
> \]
> }
> 
> client.schema.create\_class(class\_obj)
> \`\`\`
> 
> I want to let my users search for legal articles through their "titre" and "source" properties, which have been tokenized using \`lowercase\`.
> 
> Here is an example of an article I'm trying to find :
> \`\`\`
> {
> "article\_id": "JORFARTI000047663197",
> "etat": "VIGUEUR",
> "path\_title": \[
> "Titre IER : DE LA NATURE DE L'ACTIVITÉ D'INFLUENCE COMMERCIALE PAR VOIE ÉLECTRONIQUE ET DES OBLIGATIONS AFFÉRENTES À SON EXERCICE",
> "Chapitre III : Dispositions générales relatives à l'activité d'agent d'influenceur, aux contrats d'influence commerciale par voie électronique, à la responsabilité civile solidaire et à l'assurance civile professionnelle"
> \],
> "source": "LOI n° 2023-451 du 9 juin 2023 visant à encadrer l'influence commerciale et à lutter contre les dérives des influenceurs sur les réseaux sociaux (1)",
> "texte": ".....blablabla....",
> "titre": "7"
> },
> \`\`\`
> 
> Using the following query : 
> \`\`\`
> query {
> Get {
> Article(
> limit: 5,
> bm25: {
> query: "LOI 9 juin 2023 visant à encadrer l'influence"
> properties: \["source^3", "titre"\]
> }
> ) {
> article\_id
> titre
> path\_title
> texte
> source
> \_additional {
> score
> }                
> }
> }
> }
> \`\`\`
> 
> ...gives me the following results : 
> \`\`\`
> \# only printing the "titre" and "source" in a list
> \[\['2023', 'Code civil'\], \["Annexe 9 à l'article A4241-50-2", 'Code des transports'\], \["Annexe à l'article R\*351-1, art. 9", 'Code des ports maritimes'\], \['437 à 614-26', 'Code de commerce (ancien)'\], \['L79 à L85', 'Code électoral'\]\]
> \`\`\`
> 
> 
> 
> Am i missing something ? 
> It seems like it should be able to find it because i'm literally copy/pasting the exact source name.
> Could it be an issue with the lowercase tokenizer ? 
> 
> I'd be happy to provide you with further information if needed.
> 
> Thanks in advance.

---

<div class="post-metadata">

### Author: ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)
#### Post date: [September 28, 2023, 12:24pm UTC](https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648/4 "2023-09-28T12:24:14Z")

</div>

Hi @codehelen - the latest update on this bug is here. [BM25 returns no results in some situations (Original title: BM25/Tokenizer not working properly) · Issue #3517 · weaviate/weaviate · GitHub](https://github.com/weaviate/weaviate/issues/3517#issuecomment-1738310325)

The team has narrowed it down to a bug that is present for 1.21.0 and up (including the current version 1.21.4), and are working towards a fix.

I am sorry about this, but I understand the core team is working on a fix and will keep everybody updated.

---

<div class="post-metadata">

### Author: ![jphwang](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jphwang/32/38_2.png) [@jphwang](https://forum.weaviate.io/u/jphwang)
#### Post date: [October 4, 2023, 10:39am UTC](https://forum.weaviate.io/t/after-importing-the-document-into-weaviate-for-a-period-of-time-it-cannot-be-searched-using-bm25/648/5 "2023-10-04T10:39:24Z")

</div>

Hi @codehelen - I wanted to write to let you know we’ve released `1.21.5` which fixes this bug.

Release notes: [Release v1.21.5 - BM25 search no results in some situations Fix and text2vec-huggingface response parsing Fix · weaviate/weaviate · GitHub](https://github.com/weaviate/weaviate/releases/tag/v1.21.5)

Etienne, our CTO, has written a summary of the cause & fix here as well. [Fix issue where BM25 would sometimes return no results after a compaction by etiennedi · Pull Request #3592 · weaviate/weaviate · GitHub](https://github.com/weaviate/weaviate/pull/3592)

We are sorry about this, and thank you for raising it.
