Giter Club home page Giter Club logo

algolia's People

Contributors

baroshem avatar camaech avatar danielroe avatar digbyk avatar francois2metz avatar intevel avatar laruxo avatar lehoczky avatar lomonacosalvatore avatar pi0 avatar podlebar avatar renovate-bot avatar rigo-m avatar tahul avatar triloworld avatar vanling avatar vilhelmjosander avatar yassilah avatar zal1000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

algolia's Issues

Move to nuxt-modules

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Add support for SSR

Is your feature request related to a problem? Please describe.

Work on #46

Describe the solution you'd like

Describe alternatives you've considered

Additional context

DocSearch feature

Is your feature request related to a problem? Please describe.

Hey ๐Ÿ˜„

I'm working on using Algolia DocSearch on Nuxt 3 new documentation website.

I've been trying to implement the feature using your module, but it seem like this feature from Algolia is not supported.

Here is the Pull Request I'm working on: https://github.com/nuxt/nuxt3-docs/pull/15

Describe the solution you'd like

I've imported a component that we use since a while on docs project, and updated it to Composition API.

The component imports Algolia configuration from publicRuntimeConfig, which is close to what you do in this module.

We could work on having a toggleable parameter that would push a built-in component that is easy to use and take its configuration from nuxt.config.

Additional context

Algolia DocSearch is a documentation search solution made for open source projects.

It ships with an easy component and scripts that let you build indexes from your project pages.

https://docsearch.algolia.com

add section in advanced about automatic indexing using Storyblok

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

I have recently created a Nuxt 3 project with Algolia, Storyblok and automatic indexer using serverless that would be worth mentioning in the docs -> https://github.com/Baroshem/nuxt3-algolia-storyblok. We could provide step by step flow of using it with Storyblok to automaically index Algolia with a new content.

Describe alternatives you've considered

Additional context

Unable to search in <setup>

Have a problem displaying SSR data
if i use code from example

<script setup>
const { result, search } = useSearch('test_index') // pass your index name as param

onMounted(async () => {
  await search({ query: 'Samsung' });
})
</script>

all work well, but data loaded after page load, but I would like to receive data before the page is fully loaded

if i try something like this

<script setup>
const { result, search } = useSearch('test_index') // pass your index name as param
await search({ query: 'Samsung' });
</script>

i catch 500 error,
text: XMLHttpRequest is not defined

Thanks for the answer

Remove deprecated composables

Is your feature request related to a problem? Please describe.

  • useSearch
  • useSearchForFacetValues
  • useAlgolia
  • useInitIndex

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Fresh install fails

Version

@nuxtjs/algolia: 1.1.1
nuxt: 3.0.0-rc.6

Reproduction Link

none

but with version 1.1.0 is seems to work

Steps to reproduce

What is Expected?

nuxt starts correctly

What is actually happening?

nuxt does not start anymore and throws following error:

 ERROR  Cannot start nuxt:  nuxtCtx.tryUse is not a function                                              15:01:10

  at useNuxt (node_modules/@nuxtjs/algolia/node_modules/@nuxt/kit/dist/index.mjs:47:28)
  at addPlugin (node_modules/@nuxtjs/algolia/node_modules/@nuxt/kit/dist/index.mjs:434:16)
  at setup (node_modules/@nuxtjs/algolia/dist/module.mjs:183:5)
  at Object.normalizedModule (node_modules/@nuxtjs/algolia/node_modules/@nuxt/kit/dist/index.mjs:624:29)
  at async installModule (node_modules/@nuxt/kit/dist/index.mjs:432:3)
  at async initNuxt (node_modules/nuxt/dist/index.mjs:1423:7)
  at async load (node_modules/nuxi/dist/chunks/dev.mjs:6750:9)
  at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6795:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:46:20)

add Stackblitz demo

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Problem using search() outside of onMounted() hook

Have a problem displaying SSR data
if i use code from example

<script setup>
const { result, search } = useSearch('test_index') // pass your index name as param

onMounted(async () => {
  await search({ query: 'Samsung' });
})
</script>

all work well, but data loaded after page load, but I would like to receive data before the page is fully loaded

if i try something like this

<script setup>
const { result, search } = useSearch('test_index') // pass your index name as param
await search({ query: 'Samsung' });
</script>

i catch 500 error,
text: XMLHttpRequest is not defined

"nuxt": "3.0.0-rc.1",
"@nuxtjs/algolia": "^0.9.2",

How could I solve this problem?
Thanks for the answer

Query with attributes

Reading the documentation it shows a search can be done as follows:

await search({ query: 'Samsung' });

This is working as expected but I am having some trouble trying to get the intended format for passing parameters with the query. As per the Algolia documentation this is the format

index.search('query string', {
  attributesToRetrieve: ['firstname', 'lastname'],
  hitsPerPage: 50,
})

Looking at the useSearch composable

https://github.com/nuxt-community/algolia-module/blob/main/src/runtime/composables/useSearch.ts

It seems to only cater for query as a string type and the additional requestOptions

How would we structure this query?

error when updating to RC 14

Version



Reproduction Link

I have upgraded from RC 13 to RC 14 and the server doesn't even start.

Steps to reproduce

I have upgraded from RC 13 to RC 14 and the server doesn't even start.

What is Expected?

ERROR Error while requiring module @nuxtjs/algolia: SyntaxError: The requested module '@nuxt/kit' does not provide an export named 'addAutoImportDir'

What is actually happening?

ERROR Error while requiring module @nuxtjs/algolia: SyntaxError: The requested module '@nuxt/kit' does not provide an export named 'addAutoImportDir'

user privateRuntimeConfig for envs

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Fail on Nuxt 3 RC9

Version

@nuxtjs/algolia: 1.1.0
nuxt: 3.0.0-rc.9

Reproduction Link

We have updated Nuxt to version 3 RC 9 and it has thrown us an error. Please update module to work with RC 9

Add routing URLs

Is your feature request related to a problem? Please describe.

With Nuxt 2 there was a way to have routing URLs so you got for each facet clicked a change in the URL. That URL was shareable and it was a huge benefit in crosslinking a faceted search page thru the whole website.

Describe the solution you'd like

It would be nice to have this option to create urls that you can share and will lead to correct results.
(Similar to: https://www.algolia.com/doc/guides/building-search-ui/going-further/routing-urls/vue/#combining-with-nuxtjs)

Describe alternatives you've considered

Use the oldschool way with the vue 3 library and somehow integrate the router by myself but if there is such a great module it would be nice to have it out of the box instead of starting hacking :)

Browser back / router.back clears query.

Version

@nuxtjs/algolia: v0.9.2
nuxt: v3.0.0-rc.4

Reproduction Link

https://stackblitz.com/edit/nuxt-starter-9hjp9u?file=pages/index/index.page.ts

Steps to reproduce

filter twice -> go to page via ais-hits / nuxt-link (/about), use browser back. And then try to click back again.

What is Expected?

its expected it saves my query.

What is actually happening?

its clearing query. But only on first back.

heres an exsample from a productions site: https://majestic-piroshki-eafaa8.netlify.app/test-brugte-biler/

Other

when using this in app.router.options.ts

	parseQuery(query) {
		return qs.parse(query);
	},
	stringifyQuery(query) {
		const result = qs.stringify(query);

		return result ? `?${result}` : "";
	}, 

Nuxt gives this error:
image

support for automatic indexing

Is your feature request related to a problem? Please describe.

#36

Describe the solution you'd like

Describe alternatives you've considered

Additional context

extract plugin functionality to Vue plugin

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

To gain more users, Chuck Meyer inspired me to refactor the Nuxt module into a wrapper over Vue module so that it could be used in more projects than just the Nuxt ones

Describe alternatives you've considered

Additional context

Documentation issues

What is actually happening?

  • [Coming soon] for VueInstantsearch -> coming soon should be removed as there is already a support for that both README.md and docs
  • Update vue-instantsearch usage docs to have // path/to/file in the code examples and also we should add better guide on how to use it. More descriptive.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Using npm packages for Renovate presets is now deprecated. Please migrate to repository-based presets instead.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm standard-version Available

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/setup-node v3
  • actions/cache v2
npm
docs/package.json
  • nuxt 3.0.0-rc.4
package.json
  • @algolia/cache-in-memory ^4.14.2
  • @algolia/recommend ^4.12.2
  • @algolia/requester-fetch ^4.23.2
  • @nuxt/kit ^3.7.0
  • algoliasearch ^4.11.0
  • instantsearch.css ^7.4.5
  • metadata-scraper ^0.2.49
  • storyblok-algolia-indexer ^1.1.0
  • vue-instantsearch ^4.3.2
  • @docsearch/css ^3.0.0
  • @docsearch/js ^3.0.0
  • nuxt ^3.8.0
  • standard-version ^9.3.2
  • typescript ^5.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

Change logo of Algolia

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Algoliasearch type from lite version by default

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Currently, algoliasearch type is taken from lite version. This is wrong because when a user chooses lite:false in the config, he will have access to more methods and properties, but they will not be autosuggested by TS. In order to have that, we should add the type accordingly to the value of lite configuration option in the config.

Describe alternatives you've considered

Additional context

add AlgoliaSearchBar component

Is your feature request related to a problem? Please describe.

Similarly to what I have created for the nuxt-newsletter, I think it would be beneficial to have an unstyled but working search bar component that users can easily use in their application without using the vue instantsearch.

Describe the solution you'd like

https://github.com/Baroshem/nuxt-shopify-tailwind/blob/294729ad6a0d2871522bf68750a7d75128c2eb34/components/TheHeader.vue

Describe alternatives you've considered

Additional context

Filters in query

Version

Reproduction Link

I am trying to do a search with filters, but the filters parameter is not getting it for me

watch(() => input_search.value, () => search({ query: input_search.value, filters: 'domain_list:domain.es'}));

image

image

Steps to reproduce

What is Expected?

What is actually happening?

add Global Index option in configration

Is your feature request related to a problem? Please describe.

Let's add an configuration option called globalIndex that when configured will be used in algoliasearch. By using it, user will not have to pass it as a part of the useAlgoliaSearch composable.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

bump nuxt to the latest version

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

[Bug[ Vue-Instantsearch does not work for nuxt 3 project

image

It is caused by the usage of the plugin. There must be some inconsitencies in how the plugin works with vue 3, vite and nuxt. As we are importing the components separately recently, I think it would be safe to remove this line from plugin.ts:

  if (instantSearch) {
    const { plugin } = await import("vue-instantsearch/vue3/es/src/plugin");
    nuxtApp.vueApp.use(plugin);
  }

Tested on both local nuxt project from the module and completely new project with nuxt 3.

Version

@nuxtjs/algolia:
nuxt:

Reproduction Link

Steps to reproduce

What is Expected?

What is actually happening?

Add info about importing composables

Is your feature request related to a problem? Please describe.

By Alex Jover Morales:

I'd include as well how to import the composables, for those not using script setup

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Configuring via .env variables on Nuxt 3

Version

@nuxtjs/algolia: 1.1.1
nuxt: 3.0.0-rc.6

Steps to reproduce

  • Add Algolia to Nuxt 3 project
  • Configure it via env variables

What is happening?

algolia: {
    applicationId: process.env.ALGOLIA_APP_ID ?? 'applicationId',
    apiKey: process.env.ALGOLIA_API_KEY ?? 'apiKey',
  },

When starting a project error is thrown Cannot destructure property 'applicationId' of '__vite_ssr_import_0__.useRuntimeConfig(...).algolia' as it is undefined.

Not sure if this has something to do with #81 or #63 but considering the example in the playground, this should work

Rename composables to use `Algolia`

Is your feature request related to a problem? Please describe.

#40

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Failed to run nuxt after installing algolia

Version

@nuxtjs/algolia: 1.1.0
nuxt: "nuxt-edge": latest

Reproduction Link

https://github.com/starladyrie/algolia-bug

Steps to reproduce

  1. Create a new project with Nuxt 2
  2. Migrate to Nuxt Bridge
  3. Install @nuxtjs/algolia, following documentation
  4. Run project

What is Expected?

Project should run normally

What is actually happening?

Algolia is throwing the following error:

Nuxt CLI v3.0.0-rc.6                                                                                                                                                                                               16:45:31
                                                                                                                                                                                                                   16:45:33
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.31.137:3000/


 FATAL  Cannot read property 'public' of undefined                                                                                                                                                                 16:45:34

  at setup (/C:/Users/marri/Documents/algolia/algolia-bug/node_modules/@nuxtjs/algolia/dist/module.mjs:149:32)
  at ModuleContainer.normalizedModule (/C:/Users/marri/Documents/algolia/algolia-bug/node_modules/@nuxt/kit/dist/index.mjs:607:29)
  at async ModuleContainer.addModule (node_modules\@nuxt\core-edge\dist\core.js:174:20)
  at async ModuleContainer.ready (node_modules\@nuxt\core-edge\dist\core.js:47:5)
  at async Nuxt._init (node_modules\@nuxt\core-edge\dist\core.js:346:5)


 ERROR  Cannot start nuxt:  Cannot read property 'public' of undefined                                                                                                                                             16:45:34  

  at setup (/C:/Users/marri/Documents/algolia/algolia-bug/node_modules/@nuxtjs/algolia/dist/module.mjs:149:32)
  at ModuleContainer.normalizedModule (/C:/Users/marri/Documents/algolia/algolia-bug/node_modules/@nuxt/kit/dist/index.mjs:607:29)
  at async ModuleContainer.addModule (node_modules\@nuxt\core-edge\dist\core.js:174:20)
  at async ModuleContainer.ready (node_modules\@nuxt\core-edge\dist\core.js:47:5)
  at async Nuxt._init (node_modules\@nuxt\core-edge\dist\core.js:346:5)


create useIndexing composable with CRUD methods

Is your feature request related to a problem? Please describe.

Also remember, to add a new API key with appriopriate rights

Describe the solution you'd like

Describe alternatives you've considered

Additional context

add quick start vue page/component example to the docs

Is your feature request related to a problem? Please describe.

Something like:

<template>
  <div>{{ result }}</div>
</template>

<script setup>
const { result, search } = useAlgoliaSearch('test_index') // pass your index name as param
onMounted(async () => {
  await search({ query: 'Samsung' });
})
</script>

https://algolia.nuxtjs.org/getting-started/quick-start

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Using any instantSearch theme other than algolia throws an error

Version

@nuxtjs/algolia: ^0.9.1
nuxt: 3.0.0-rc.3

Steps to reproduce

algolia: {
    apiKey: "82913680b786acdb395702cbbe8ad805",
    applicationId: "JQ8RQBS5H4",
    instantSearch: {
      theme: "reset",
    },
  },

What is Expected?

As per the docs https://algolia.nuxtjs.org/advanced/
"You can choose a theme from satelite, reset, and algolia. Check out setup docs here"

What is actually happening?

ERROR [@nuxtjs/algolia] Invalid theme: reset
ERROR [@nuxtjs/algolia] Invalid theme: satelite

Setup docs also goes to a broken link
https://algolia.nuxtjs.org/advanced/'/setup#instantSearch.theme'

Algolia Crawler using Nuxt

Is your feature request related to a problem? Please describe.

No.

Describe the solution you'd like

The idea would be to add the ability to store pages' metadata into an Algolia index during Nuxt generation process. This would then allow for instant search through all generated pages content.

Describe alternatives you've considered

The existing Algolia Crawler does basically the same thing but having it as a Nuxt module has several advantages:

  • the Crawler is available but as a paid add-on;
  • there is a Netlify plugin but having the process done during Nuxt generation would allow for a host agnostic content indexing;
  • it would give full control over how and which data is indexed during the generation process using Nuxt hooks;
  • it should be quite straightforward to use the useSearch composable and even create a simple <NuxtPagesSearch /> component (or whatever we might want to call it).

Additional context

For the crawler to work we would need some extra module options. Here's a suggestion of how it could look like:

interface Options {
    applicationId: string;
    indexName: string;
    search: {
        apiKey: string
        apiAdminKey: string
        fields?:
            | ((route: string, html: string) => Record<string, string>)
            | string[] // array of metadata fields to include in the index or function that returns a metadata object 
        include?: ((route: string) => boolean) | (string | RegExp)[] // array of routes to include or function to filter out routes
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.