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

Ada beberapa desa yang memiliki kode pos yang sama #2

Open
ramdanplusplus opened this issue Dec 21, 2023 · 1 comment
Open

Ada beberapa desa yang memiliki kode pos yang sama #2

ramdanplusplus opened this issue Dec 21, 2023 · 1 comment

Comments

@ramdanplusplus
Copy link

ramdanplusplus commented Dec 21, 2023

Ada beberapa desa yang memiliki kode pos yang sama.
Desa di kecamatan Ujungjaya memiliki kode pos 45383 adalah: Ujungjaya, Palabuan, Palasari, Keboncau, Sakurjaya, Kudangwangi, Sukamulya, Cipelang, dan Cibuluh.

Saya lihat field code itu unique, jadi untuk "ref" bisa menggunakan field "code" dari pada field "postal". Untuk sementara saya melakukan perubahan seperti dibawah ini.

`
/src/main.js

    // const elastic = elasticlunr(function () {
    //     fields.forEach(field => this.addField(field)); 
    //     this.setRef("postal");
    // });

   const elastic = elasticlunr(function () {
        fields.forEach(field => this.addField(field)); 
        this.setRef("code");
    });

`

And

`
/src/main.js

    // search.forEach(item => results.push(this.data.find(i => i.postal === Number(item.ref))));
    search.forEach(item => results.push(this.data.find(i => i.code === item.ref)));

`

@drizki
Copy link
Owner

drizki commented Jan 28, 2024

Good point. Silahkan membuat PR jika ingin diikutsertakan ke rilis berikutnya.

Terima kasih.

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